aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2014-12-09 07:25:59 -0500
committerIngo Molnar <mingo@kernel.org>2014-12-11 05:45:03 -0500
commitbe9d1738b17f066b9d2f9e63eb6e2abda997fa1b (patch)
tree275c55218a5b21e52eaef302e415bb6e50ef9b7a
parent5de2b61a63f0982641eb00b9a6a9650f23487eaa (diff)
x86/asm: Unify segment selector defines
Those are identical on 32- and 64-bit, unify them. No functional change. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/1418127959-29902-1-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/segment.h30
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 */