From 1104c278e396860567c4d20ff2b0868fa6b02696 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sun, 8 Jan 2017 19:57:45 +1100 Subject: cpu/x86/smm: Fix explicit 'addr32' usage in clang builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The addr32 prefix is required by binutils, because even when given an explicit address which is greater than 64KiB, it will throw a warning about truncation, and stupidly emit the opcode with a 16-bit addressing mode and the wrong address. However, in the case of LLVM, this doesn't happen, and is happy to just use 32-bit addressing whenever it may require it. This means that LLVM never really needs an explicit addr32 prefix to use 32-bit addressing in 16-bit mode. Change-Id: Ia160d3f7da6653ea24c8229dc26f265e5f15aabb Also-by: Damien Zammit Signed-off-by: Damien Zammit Reviewed-on: https://review.coreboot.org/21219 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Philippe Mathieu-Daudé --- src/include/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/include') diff --git a/src/include/compiler.h b/src/include/compiler.h index a830239009..268064d0c2 100644 --- a/src/include/compiler.h +++ b/src/include/compiler.h @@ -26,4 +26,10 @@ #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 -- cgit v1.2.3