From 15ee09b40831ae88eb8a804a647b6935eb8b7114 Mon Sep 17 00:00:00 2001 From: Glauber de Oliveira Costa Date: Wed, 30 Jan 2008 13:31:09 +0100 Subject: x86: unify common parts of segment.h Although segment handling in i386 and x86_64 are very different, there's a common part. Put them in segment.h instead of arch specific headers Signed-off-by: Glauber de Oliveira Costa Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/segment.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/asm-x86/segment.h') diff --git a/include/asm-x86/segment.h b/include/asm-x86/segment.h index b3a7a3e9fb19..3c9b306bc4bf 100644 --- a/include/asm-x86/segment.h +++ b/include/asm-x86/segment.h @@ -11,4 +11,20 @@ #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 GDT_SIZE (GDT_ENTRIES * 8) +#define GDT_ENTRY_TLS_ENTRIES 3 +#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) + #endif -- cgit v1.2.2