Intel 253668-032US Benutzerhandbuch

Seite von 806
2-6   Vol. 3
SYSTEM ARCHITECTURE OVERVIEW
The architecture also defines a set of special descriptors called gates (call gates, 
interrupt gates, trap gates, and task gates). These provide protected gateways to 
system procedures and handlers that may operate at a different privilege level than 
application programs and most procedures. For example, a CALL to a call gate can 
provide access to a procedure in a code segment that is at the same or a numerically 
lower privilege level (more privileged) than the current code segment. To access a 
procedure through a call gate, the calling procedure
1
 supplies the selector for the call 
gate. The processor then performs an access rights check on the call gate, comparing 
the CPL with the privilege level of the call gate and the destination code segment 
pointed to by the call gate. 
If access to the destination code segment is allowed, the processor gets the segment 
selector for the destination code segment and an offset into that code segment from 
the call gate. If the call requires a change in privilege level, the processor also 
switches to the stack for the targeted privilege level. The segment selector for the 
new stack is obtained from the TSS for the currently running task. Gates also facili-
tate transitions between 16-bit and 32-bit code segments, and vice versa. 
2.1.2.1  
Gates in IA-32e Mode
In IA-32e mode, the following descriptors are 16-byte descriptors (expanded to allow 
a 64-bit base): LDT descriptors, 64-bit TSSs, call gates, interrupt gates, and trap 
gates.
Call gates facilitate transitions between 64-bit mode and compatibility mode. Task 
gates are not supported in IA-32e mode. On privilege level changes, stack segment 
selectors are not read from the TSS. Instead, they are set to NULL.
2.1.3 
Task-State Segments and Task Gates
The TSS (see Figure 2-1) defines the state of the execution environment for a task. 
It includes the state of general-purpose registers, segment registers, the EFLAGS 
register, the EIP register, and segment selectors with stack pointers for three stack 
segments (one stack for each privilege level). The TSS also includes the segment 
selector for the LDT associated with the task and the base address of the paging-
structure hierarchy. 
All program execution in protected mode happens within the context of a task (called 
the current task). The segment selector for the TSS for the current task is stored in 
the task register. The simplest method for switching to a task is to make a call or 
jump to the new task. Here, the segment selector for the TSS of the new task is given 
in the CALL or JMP instruction. In switching tasks, the processor performs the 
following actions:
1. Stores the state of the current task in the current TSS.
1. The word “procedure” is commonly used in this document as a general term for a logical unit or 
block of code (such as a program, procedure, function, or routine).