diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-30 07:30:48 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:48 -0500 |
commit | 2608a6584a0a32d3251dfafad31d9f8b2c784466 (patch) | |
tree | 3d790ff15328fe7879cfbe003f1f0e23a91654be /include/asm-x86/segment_64.h | |
parent | fb7fa8f1741c91f6c6e958762155abe9339476ca (diff) |
x86: segment selector macros
This copies into asm-x86/segment_64.h some macros from asm-x86/segment_32.h
for dissecting segment selectors. This lets other code use these macros
uniformly on 32/64-bit rather than duplicating the constants elsewhere.
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/segment_64.h')
-rw-r--r-- | include/asm-x86/segment_64.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-x86/segment_64.h b/include/asm-x86/segment_64.h index 04b8ab21328f..dce742101348 100644 --- a/include/asm-x86/segment_64.h +++ b/include/asm-x86/segment_64.h | |||
@@ -50,4 +50,15 @@ | |||
50 | #define GDT_SIZE (GDT_ENTRIES * 8) | 50 | #define GDT_SIZE (GDT_ENTRIES * 8) |
51 | #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) | 51 | #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) |
52 | 52 | ||
53 | /* Bottom two bits of selector give the ring privilege level */ | ||
54 | #define SEGMENT_RPL_MASK 0x3 | ||
55 | /* Bit 2 is table indicator (LDT/GDT) */ | ||
56 | #define SEGMENT_TI_MASK 0x4 | ||
57 | |||
58 | /* User mode is privilege level 3 */ | ||
59 | #define USER_RPL 0x3 | ||
60 | /* LDT segment has TI set, GDT has it cleared */ | ||
61 | #define SEGMENT_LDT 0x4 | ||
62 | #define SEGMENT_GDT 0x0 | ||
63 | |||
53 | #endif | 64 | #endif |