From 3256e9e00b64ace0f04665632889051cc0af8e1f Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Tue, 12 Nov 2019 15:50:49 -0800 Subject: [PATCH] x86: use BIT() macros for cr0/cr4 bits Easier to establish correspondence with the technical manuals. Signed-off-by: Andrew Boie --- arch/x86/include/kernel_arch_data.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/kernel_arch_data.h b/arch/x86/include/kernel_arch_data.h index 2f9d3f62ad2..d5c9d9aefdb 100644 --- a/arch/x86/include/kernel_arch_data.h +++ b/arch/x86/include/kernel_arch_data.h @@ -48,10 +48,11 @@ * Control register definitions. */ -#define CR0_PG 0x80000000 /* enable paging */ -#define CR0_WP 0x00010000 /* honor W bit even when supervisor */ -#define CR4_PAE 0x00000020 /* enable PAE */ -#define CR4_OSFXSR 0x00000200 /* enable SSE (OS FXSAVE/RSTOR) */ +#define CR0_PG BIT(31) /* enable paging */ +#define CR0_WP BIT(16) /* honor W bit even when supervisor */ + +#define CR4_PAE BIT(5) /* enable PAE */ +#define CR4_OSFXSR BIT(9) /* enable SSE (OS FXSAVE/RSTOR) */ #ifdef CONFIG_X86_64 #include