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.
 | 
					 * found in smm.h.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <cpu/x86/cr.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.code32
 | 
					.code32
 | 
				
			||||||
.section ".module_parameters", "aw", @progbits
 | 
					.section ".module_parameters", "aw", @progbits
 | 
				
			||||||
stub_entry_params:
 | 
					stub_entry_params:
 | 
				
			||||||
@@ -53,6 +55,10 @@ fallback_stack_bottom:
 | 
				
			|||||||
.skip 128
 | 
					.skip 128
 | 
				
			||||||
fallback_stack_top:
 | 
					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
 | 
					.text
 | 
				
			||||||
.code16
 | 
					.code16
 | 
				
			||||||
.global _start
 | 
					.global _start
 | 
				
			||||||
@@ -61,8 +67,8 @@ _start:
 | 
				
			|||||||
	data32	lgdt (%ebx)
 | 
						data32	lgdt (%ebx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	movl	%cr0, %eax
 | 
						movl	%cr0, %eax
 | 
				
			||||||
	andl	$0x1FFAFFD1, %eax /* CD,NW,PG,AM,WP,NE,TS,EM,MP = 0 */
 | 
						andl	$~CR0_CLEAR_FLAGS, %eax
 | 
				
			||||||
	orl	$0x1, %eax        /* PE = 1 */
 | 
						orl	$CR0_PE, %eax
 | 
				
			||||||
	movl	%eax, %cr0
 | 
						movl	%eax, %cr0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Enable protected mode */
 | 
						/* Enable protected mode */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user