cpu/x86/smm: use macros for CR0 flags
Use the existing macros for CR0 to set the flags in the SMM stub. Change-Id: I0f02fd6b0c14cee35ec33be2cac51057d18b82c0 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/20242 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
		| @@ -23,6 +23,8 @@ | ||||
|  * found in smm.h. | ||||
|  */ | ||||
|  | ||||
| #include <cpu/x86/cr.h> | ||||
|  | ||||
| .code32 | ||||
| .section ".module_parameters", "aw", @progbits | ||||
| stub_entry_params: | ||||
| @@ -53,6 +55,10 @@ fallback_stack_bottom: | ||||
| .skip 128 | ||||
| fallback_stack_top: | ||||
|  | ||||
| #define CR0_CLEAR_FLAGS \ | ||||
| 	(CR0_CD | CR0_NW | CR0_PG | CR0_AM | CR0_WP | \ | ||||
| 	 CR0_NE | CR0_TS | CR0_EM | CR0_MP) | ||||
|  | ||||
| .text | ||||
| .code16 | ||||
| .global _start | ||||
| @@ -61,8 +67,8 @@ _start: | ||||
| 	data32	lgdt (%ebx) | ||||
|  | ||||
| 	movl	%cr0, %eax | ||||
| 	andl	$0x1FFAFFD1, %eax /* CD,NW,PG,AM,WP,NE,TS,EM,MP = 0 */ | ||||
| 	orl	$0x1, %eax        /* PE = 1 */ | ||||
| 	andl	$~CR0_CLEAR_FLAGS, %eax | ||||
| 	orl	$CR0_PE, %eax | ||||
| 	movl	%eax, %cr0 | ||||
|  | ||||
| 	/* Enable protected mode */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user