summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2017-06-16 14:12:55 -0500
committerAaron Durbin <adurbin@chromium.org>2017-06-22 03:45:56 +0000
commit9e01a0be89f685e7f74392564ebdeaaf78359a50 (patch)
tree84544d8e11d5ccfde2cb06f0f5e22c1548309a3b /src
parent25a885b52dc4184b20c088683588d38bf68a6069 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/cpu/x86/smm/smm_stub.S10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cpu/x86/smm/smm_stub.S b/src/cpu/x86/smm/smm_stub.S
index d1fe7c1146..e1f6e5f9f2 100644
--- a/src/cpu/x86/smm/smm_stub.S
+++ b/src/cpu/x86/smm/smm_stub.S
@@ -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 */