diff options
Diffstat (limited to 'arch/x86/include/asm/segment.h')
-rw-r--r-- | arch/x86/include/asm/segment.h | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 6f1c3a8a33ab..db257a58571f 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h | |||
@@ -23,6 +23,15 @@ | |||
23 | #define GDT_ENTRY_BOOT_TSS (GDT_ENTRY_BOOT_CS + 2) | 23 | #define GDT_ENTRY_BOOT_TSS (GDT_ENTRY_BOOT_CS + 2) |
24 | #define __BOOT_TSS (GDT_ENTRY_BOOT_TSS * 8) | 24 | #define __BOOT_TSS (GDT_ENTRY_BOOT_TSS * 8) |
25 | 25 | ||
26 | #define SEGMENT_RPL_MASK 0x3 /* | ||
27 | * Bottom two bits of selector give the ring | ||
28 | * privilege level | ||
29 | */ | ||
30 | #define SEGMENT_TI_MASK 0x4 /* Bit 2 is table indicator (LDT/GDT) */ | ||
31 | #define USER_RPL 0x3 /* User mode is privilege level 3 */ | ||
32 | #define SEGMENT_LDT 0x4 /* LDT segment has TI set... */ | ||
33 | #define SEGMENT_GDT 0x0 /* ... GDT has it cleared */ | ||
34 | |||
26 | #ifdef CONFIG_X86_32 | 35 | #ifdef CONFIG_X86_32 |
27 | /* | 36 | /* |
28 | * The layout of the per-CPU GDT under Linux: | 37 | * The layout of the per-CPU GDT under Linux: |
@@ -125,16 +134,6 @@ | |||
125 | #define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8) /* transfer data segment */ | 134 | #define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8) /* transfer data segment */ |
126 | #define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8) /* another data segment */ | 135 | #define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8) /* another data segment */ |
127 | 136 | ||
128 | /* Bottom two bits of selector give the ring privilege level */ | ||
129 | #define SEGMENT_RPL_MASK 0x3 | ||
130 | /* Bit 2 is table indicator (LDT/GDT) */ | ||
131 | #define SEGMENT_TI_MASK 0x4 | ||
132 | |||
133 | /* User mode is privilege level 3 */ | ||
134 | #define USER_RPL 0x3 | ||
135 | /* LDT segment has TI set, GDT has it cleared */ | ||
136 | #define SEGMENT_LDT 0x4 | ||
137 | #define SEGMENT_GDT 0x0 | ||
138 | 137 | ||
139 | /* | 138 | /* |
140 | * Matching rules for certain types of segments. | 139 | * Matching rules for certain types of segments. |
@@ -192,17 +191,6 @@ | |||
192 | #define get_kernel_rpl() 0 | 191 | #define get_kernel_rpl() 0 |
193 | #endif | 192 | #endif |
194 | 193 | ||
195 | /* User mode is privilege level 3 */ | ||
196 | #define USER_RPL 0x3 | ||
197 | /* LDT segment has TI set, GDT has it cleared */ | ||
198 | #define SEGMENT_LDT 0x4 | ||
199 | #define SEGMENT_GDT 0x0 | ||
200 | |||
201 | /* Bottom two bits of selector give the ring privilege level */ | ||
202 | #define SEGMENT_RPL_MASK 0x3 | ||
203 | /* Bit 2 is table indicator (LDT/GDT) */ | ||
204 | #define SEGMENT_TI_MASK 0x4 | ||
205 | |||
206 | #define IDT_ENTRIES 256 | 194 | #define IDT_ENTRIES 256 |
207 | #define NUM_EXCEPTION_VECTORS 32 | 195 | #define NUM_EXCEPTION_VECTORS 32 |
208 | /* Bitmask of exception vectors which push an error code on the stack */ | 196 | /* Bitmask of exception vectors which push an error code on the stack */ |