summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-08-04 12:33:54 -0600
committerSimon Glass <sjg@chromium.org>2015-08-05 08:44:07 -0600
commit7dfe8bdeef7f8a7223fb39e04faaa5c7489feb3f (patch)
tree8f932320d7cc091e8642742fc4e77661a8cb4bbd /arch/x86/include
parentb997abd3f06f136b226431a2947520dd5a426869 (diff)
downloadtalos-obmc-uboot-7dfe8bdeef7f8a7223fb39e04faaa5c7489feb3f.tar.gz
talos-obmc-uboot-7dfe8bdeef7f8a7223fb39e04faaa5c7489feb3f.zip
x86: Add an enum for some commonly-used GDT bits
Rather than add these as open-coded values, create an enum with the commonly used flags. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/cpu.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 08284ee295..5b891394fb 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -27,6 +27,24 @@ enum {
X86_VENDOR_UNKNOWN = 0xff
};
+/* Global descriptor table (GDT) bits */
+enum {
+ GDT_4KB = 1ULL << 55,
+ GDT_32BIT = 1ULL << 54,
+ GDT_LONG = 1ULL << 53,
+ GDT_PRESENT = 1ULL << 47,
+ GDT_NOTSYS = 1ULL << 44,
+ GDT_CODE = 1ULL << 43,
+ GDT_LIMIT_LOW_SHIFT = 0,
+ GDT_LIMIT_LOW_MASK = 0xffff,
+ GDT_LIMIT_HIGH_SHIFT = 48,
+ GDT_LIMIT_HIGH_MASK = 0xf,
+ GDT_BASE_LOW_SHIFT = 16,
+ GDT_BASE_LOW_MASK = 0xffff,
+ GDT_BASE_HIGH_SHIFT = 56,
+ GDT_BASE_HIGH_MASK = 0xf,
+};
+
struct cpuid_result {
uint32_t eax;
uint32_t ebx;
OpenPOWER on IntegriCloud