summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2012-11-28 20:19:23 -0800
committerDavid Hendricks <dhendrix@chromium.org>2012-11-30 00:03:45 +0100
commit421288d6e6924bfb814ba06050be048b891719a9 (patch)
tree49293eacb8c769dd752cd8326e3294c916aaf732
parent5367e47ef1d53cd2effafc0b4832af15bdc8fd21 (diff)
Make libgcc wrappers arch-specific, add ARMv7
Change-Id: Ia0bbd3bec6588219ce24951c0bcebefc6b6ec80e Signed-off-by: Stefan Reinauer <reinauer@google.com> Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/1940 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
-rw-r--r--src/lib/gcc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/gcc.c b/src/lib/gcc.c
index 9b6ef035b2..daba427d25 100644
--- a/src/lib/gcc.c
+++ b/src/lib/gcc.c
@@ -22,10 +22,21 @@
* compiler call specifies. Therefore we need a wrapper around those
* functions. See gcc bug PR41055 for more information.
*/
+
+#if CONFIG_ARCH_X86
#define WRAP_LIBGCC_CALL(type, name) \
type __real_##name(type a, type b) __attribute__((regparm(0))); \
type __wrap_##name(type a, type b); \
type __wrap_##name(type a, type b) { return __real_##name(a, b); }
+#elif CONFIG_ARCH_ARMV7
+#define WRAP_LIBGCC_CALL(type, name) \
+ type __real_##name(type a, type b); \
+ type __wrap_##name(type a, type b); \
+ type __wrap_##name(type a, type b) { return __real_##name(a, b); }
+#else
+#error Architecture unsupported.
+#endif
+
WRAP_LIBGCC_CALL(long long, __divdi3)
WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)