]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
x86/asm: Unify segment selector defines
authorBorislav Petkov <bp@suse.de>
Tue, 9 Dec 2014 12:25:59 +0000 (13:25 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 11 Dec 2014 10:45:03 +0000 (11:45 +0100)
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>
arch/x86/include/asm/segment.h

index 6f1c3a8a33ab01c35313d0339ce6ebc075d701fd..db257a58571f0b47429e2dcc70cf628f1a968fe4 100644 (file)
 #define GDT_ENTRY_BOOT_TSS     (GDT_ENTRY_BOOT_CS + 2)
 #define __BOOT_TSS             (GDT_ENTRY_BOOT_TSS * 8)
 
+#define SEGMENT_RPL_MASK       0x3 /*
+                                    * Bottom two bits of selector give the ring
+                                    * privilege level
+                                    */
+#define SEGMENT_TI_MASK                0x4 /* Bit 2 is table indicator (LDT/GDT) */
+#define USER_RPL               0x3 /* User mode is privilege level 3 */
+#define SEGMENT_LDT            0x4 /* LDT segment has TI set... */
+#define SEGMENT_GDT            0x0 /* ... GDT has it cleared */
+
 #ifdef CONFIG_X86_32
 /*
  * The layout of the per-CPU GDT under Linux:
 #define PNP_TS1    (GDT_ENTRY_PNPBIOS_TS1 * 8) /* transfer data segment */
 #define PNP_TS2    (GDT_ENTRY_PNPBIOS_TS2 * 8) /* another data segment */
 
-/* Bottom two bits of selector give the ring privilege level */
-#define SEGMENT_RPL_MASK       0x3
-/* Bit 2 is table indicator (LDT/GDT) */
-#define SEGMENT_TI_MASK                0x4
-
-/* User mode is privilege level 3 */
-#define USER_RPL               0x3
-/* LDT segment has TI set, GDT has it cleared */
-#define SEGMENT_LDT            0x4
-#define SEGMENT_GDT            0x0
 
 /*
  * Matching rules for certain types of segments.
 #define get_kernel_rpl()  0
 #endif
 
-/* User mode is privilege level 3 */
-#define USER_RPL               0x3
-/* LDT segment has TI set, GDT has it cleared */
-#define SEGMENT_LDT            0x4
-#define SEGMENT_GDT            0x0
-
-/* Bottom two bits of selector give the ring privilege level */
-#define SEGMENT_RPL_MASK       0x3
-/* Bit 2 is table indicator (LDT/GDT) */
-#define SEGMENT_TI_MASK                0x4
-
 #define IDT_ENTRIES 256
 #define NUM_EXCEPTION_VECTORS 32
 /* Bitmask of exception vectors which push an error code on the stack */