]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
x86: Reformat and extend CR0 constants
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 16 Mar 2015 08:18:56 +0000 (09:18 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 20 Mar 2015 13:08:05 +0000 (14:08 +0100)
Encode CR0 constants in an easier readable form and add some bits we
will need soon. Also add a mask of the reserved bits that need to be
left as-is on modifications.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/include/asm/processor.h

index ba9cbf26131a421fa2da90a12c50d3be8668cf84..4560c0212b68eb168251a4aef40471c987714282 100644 (file)
 
 #define X86_RFLAGS_VM                                  (1 << 17)
 
-#define X86_CR0_PE                                     0x00000001
-#define X86_CR0_ET                                     0x00000010
-#define X86_CR0_WP                                     0x00010000
-#define X86_CR0_NW                                     0x20000000
-#define X86_CR0_CD                                     0x40000000
-#define X86_CR0_PG                                     0x80000000
+#define X86_CR0_PE                                     (1UL << 0)
+#define X86_CR0_MP                                     (1UL << 1)
+#define X86_CR0_TS                                     (1UL << 3)
+#define X86_CR0_ET                                     (1UL << 4)
+#define X86_CR0_NE                                     (1UL << 5)
+#define X86_CR0_WP                                     (1UL << 16)
+#define X86_CR0_NW                                     (1UL << 29)
+#define X86_CR0_CD                                     (1UL << 30)
+#define X86_CR0_PG                                     (1UL << 31)
+#define X86_CR0_RESERVED                               \
+       (BIT_MASK(28, 19) |  (1UL << 17) | BIT_MASK(15, 6))
 
 #define X86_CR4_PAE                                    0x00000020
 #define X86_CR4_PGE                                    0x00000080