English
Language : 

GX1 Datasheet, PDF (74/247 Pages) National Semiconductor (TI) – Processor Series Low Power Integrated x86 Solution
Processor Programming (Continued)
Gate Descriptors
Four kinds of gate descriptors are used to provide protec-
tion during control transfers:
• Call gates
• Trap gates
• Interrupt gates
• Task gates
(For more information on protection refer to Section 3.9
“Protection” on page 91.)
Call Gate Descriptor (CGD). Call gates are used to define
legal entry points to a procedure with a higher privilege
level. The call gates are used by CALL and JUMP instruc-
tions in much the same manner as code segment descrip-
tors. When a decoded instruction refers to a call gate
descriptor in the GDT or LDT, the call gate is used to point
to another descriptor in the table that defines the destina-
tion code segment.
The following privilege levels are tested during the transfer
through the call gate:
• CPL = Current Privilege Level
• RPL = Segment Selector Field
• DPL = Descriptor Privilege Level in the call gate
descriptor
• DPL = Descriptor Privilege Level in the destination code
segment
The maximum value of the CPL and RPL must be equal or
less than the gate DPL. For a JMP instruction the destina-
tion DPL equals the CPL. For a CALL instruction the desti-
nation DPL is less than or equal to the CPL.
Conforming Code Segments. Transfer to a procedure
with a higher privilege level can also be accomplished by
bypassing the use of call gates, if the requested procedure
is to be executed in a conforming code segment. Conform-
ing code segments have the C bit set in the TYPE field in
their descriptor.
The bit structure and definitions for gate descriptors are
shown in Tables 3-24 and 3-25.
Table 3-24. Gate Descriptors
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Offset +4
Memory Offset +0
OFFSET[31:16]
SELECTOR[15:0]
P DPL 0
TYPE
0 0 0 PARAMETERS
OFFSET[15:0]
Bit
31:16
15:0
31:16
15
14:13
11:8
4:0
Memory
Offset
+4
+0
+0
+4
+4
+4
+4
Table 3-25. Gate Descriptors Bit Definitions
Name
OFFSET
Description
Offset: Offset used during a call gate to calculate the branch target.
SELECTOR
P
DPL
TYPE
PARAMETERS
Segment Selector
Segment Present
Descriptor Privilege Level
Segment Type:
0100 = 16-bit call gate
0101 = Task gate
0110 = 16-bit interrupt gate
0111 = 16-bit trap gate
1100 = 32-bit call gate
1110 = 32-bit interrupt gate
1111 = 32-bit trap gate
Parameters: Number of parameters to copy from the caller’s stack to the called procedure’s
stack.
www.national.com
74
Revision 1.0