summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-12 15:42:58 -0600
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-13 04:03:06 +0100
commitaf4bd599ca84478c9109a4bdba43a790ec5bbc2f (patch)
treebc84586a032b9fce953b96084237d1dc56b49a57 /src/arch/x86
parent910ce017571b85f2139c9ab1fcd94a8a88dd4f48 (diff)
downloadcoreboot-af4bd599ca84478c9109a4bdba43a790ec5bbc2f.tar.xz
lib: Make log2() available in romstage on ARM, not just x86
On x86, log2() is defined as an inline function in arch/io.h. This is a remnant of ROMCC, and forced us to not include clog2.c in romstage. As a result, romstage on ARM has no log2(). Use the inline log2 only with ROMCC, but otherwise, use the one in clog2.c. Change-Id: Ifef2aa0a7b5a1db071a66f2eec0be421b8b2a56d Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4681 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/include/arch/io.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index 955d8e2f91..b10fb8a7cf 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -167,7 +167,8 @@ static inline __attribute__((always_inline)) void write32(unsigned long addr, ui
*((volatile uint32_t *)(addr)) = value;
}
-#if defined(__PRE_RAM__) || defined(__SMM__)
+/* Conflicts with definition in lib.h */
+#if defined(__ROMCC__) || defined(__SMM__)
static inline int log2(int value)
{
unsigned int r = 0;
@@ -180,6 +181,9 @@ static inline int log2(int value)
return r;
}
+#endif
+
+#if defined(__PRE_RAM__) || defined(__SMM__)
static inline int log2f(int value)
{
unsigned int r = 0;