background image

7-6 Vol. 3A

TASK MANAGEMENT

The base, limit, and DPL fields and the granularity and present flags have functions similar to their use in data-
segment descriptors (see Section 3.4.5, “Segment Descriptors”). When the G flag is 0 in a TSS descriptor for a 32-
bit TSS, the limit field must have a value equal to or greater than 67H, one byte less than the minimum size of a 
TSS. Attempting to switch to a task whose TSS descriptor has a limit less than 67H generates an invalid-TSS excep-
tion (#TS). A larger limit is required if an I/O permission bit map is included or if the operating system stores addi-
tional data. The processor does not check for a limit greater than 67H on a task switch; however, it does check 
when accessing the I/O permission bit map or interrupt redirection bit map.
Any program or procedure with access to a TSS descriptor (that is, whose CPL is numerically equal to or less than 
the DPL of the TSS descriptor) can dispatch the task with a call or a jump. 
In most systems, the DPLs of TSS descriptors are set to values less than 3, so that only privileged software can 
perform task switching. However, in multitasking applications, DPLs for some TSS descriptors may be set to 3 to 
allow task switching at the application (or user) privilege level.

7.2.3 

TSS Descriptor in 64-bit mode

In 64-bit mode, task switching is not supported, but TSS descriptors still exist. The format of a 64-bit TSS is 
described in Section 7.7. 
In 64-bit mode, the TSS descriptor is expanded to 16 bytes (see Figure 7-4). This expansion also applies to an LDT 
descriptor in 64-bit mode. Table 3-2 provides the encoding information for the segment type field.

Figure 7-3.  TSS Descriptor

31

24 23 22 21 20 19

16 15

13

14

12 11

8 7

0

P

Base 31:24

G

D
P

L

Type

0

0

31

16 15

0

Base Address 15:00

Segment Limit 15:00

Base 23:16

A
V

L

Limit

19:16

0

1

B

0

1

TSS Descriptor

AVL
B
BASE
DPL
G

Available for use by system software
Busy flag
Segment Base Address
Descriptor Privilege Level
Granularity

LIMIT
P
TYPE

Segment Limit
Segment Present
Segment Type

0

4