User's Manual

Vol. 3 5-21
PROTECTION
Target code segments referenced by a 64-bit call gate must be 64-bit code
segments (CS.L = 1, CS.D = 0). If not, the reference generates a general-
protection exception, #GP (CS selector).
Only 64-bit mode call gates can be referenced in IA-32e mode (64-bit mode and
compatibility mode). The legacy 32-bit mode call gate type (0CH) is redefined in
IA-32e mode as a 64-bit call-gate type; no 32-bit call-gate type exists in IA-32e
mode.
If a far call references a 16-bit call gate type (04H) in IA-32e mode, a general-
protection exception (#GP) is generated.
When a call references a 64-bit mode call gate, actions taken are identical to those
taken in 32-bit mode, with the following exceptions:
Stack pushes are made in eight-byte increments.
A 64-bit RIP is pushed onto the stack.
Parameter copying is not performed.
Use a matching far-return instruction size for correct operation (returns from 64-bit
calls must be performed with a 64-bit operand-size return to process the stack
correctly).
Figure 5-9. Call-Gate Descriptor in IA-32e Mode
31
8
7
0
P
Offset in Segment 31:16
D
P
L
Type
0
4
31
16
15
0
Segment Selector
Offset in Segment 15:00
0
.
0011
P
DPL
Gate Valid
Descriptor Privilege Level
31
0
0
16
31
0
Offset in Segment 63:31
8
0000
0
13 12 11 10 9 8 7
16 15 14 13 12 11
Reserved
Reserved
Type