[coreboot-gerrit] Change in coreboot[master]: Move ADDR32() hack to arch/x86

Patrick Georgi (Code Review) gerrit at coreboot.org
Mon Sep 4 17:39:14 CEST 2017


Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/21392


Change subject: Move ADDR32() hack to arch/x86
......................................................................

Move ADDR32() hack to arch/x86

It's arch specific, so no need to pollute non-x86 with it.

Change-Id: I99ec76d591789db186e8a33774565e5a04fc4e47
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
M src/arch/x86/include/arch/registers.h
M src/cpu/x86/smm/smmrelocate.S
M src/include/compiler.h
3 files changed, 9 insertions(+), 7 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/21392/1

diff --git a/src/arch/x86/include/arch/registers.h b/src/arch/x86/include/arch/registers.h
index 76fda28..9a618f4 100644
--- a/src/arch/x86/include/arch/registers.h
+++ b/src/arch/x86/include/arch/registers.h
@@ -18,6 +18,7 @@
 
 #include <compiler.h>
 
+#if !defined(__ASSEMBLER__)
 #define DOWNTO8(A) \
 	union { \
 		struct { \
@@ -57,5 +58,12 @@
 	uint32_t cs;
 	uint32_t eflags;
 };
+#endif // !ASSEMBLER
+
+#if IS_ENABLED(CONFIG_COMPILER_LLVM_CLANG)
+#define ADDR32(opcode) opcode
+#else
+#define ADDR32(opcode) addr32 opcode
+#endif
 
 #endif
diff --git a/src/cpu/x86/smm/smmrelocate.S b/src/cpu/x86/smm/smmrelocate.S
index b3be51d..230c78d 100644
--- a/src/cpu/x86/smm/smmrelocate.S
+++ b/src/cpu/x86/smm/smmrelocate.S
@@ -37,7 +37,7 @@
 #endif
 
 // ADDR32() macro
-#include <compiler.h>
+#include <arch/registers.h>
 
 #if IS_ENABLED(CONFIG_SMM_TSEG)
 #error "Don't use this file with TSEG."
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 268064d..a830239 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -26,10 +26,4 @@
 #define __always_unused __attribute__((unused))
 #define __must_check __attribute__((warn_unused_result))
 
-#if IS_ENABLED(CONFIG_COMPILER_LLVM_CLANG)
-#define ADDR32(opcode) opcode
-#else
-#define ADDR32(opcode) addr32 opcode
-#endif
-
 #endif

-- 
To view, visit https://review.coreboot.org/21392
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I99ec76d591789db186e8a33774565e5a04fc4e47
Gerrit-Change-Number: 21392
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170904/59c35658/attachment.html>


More information about the coreboot-gerrit mailing list