[PATCH] blackfin: lib: ucmpdi2: Add ucmpdi2 from libgcc2

From: Chen Gang
Date: Sun Apr 05 2015 - 01:17:00 EST


Just copy the output of "gcc -S". The related error:

kernel/built-in.o: In function `perf_swevent_init':
kernel/events/core.c:(.text+0xa97e4): undefined reference to `__ucmpdi2'
make: *** [vmlinux] Error 1

Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
---
arch/blackfin/kernel/bfin_ksyms.c | 2 ++
arch/blackfin/lib/Makefile | 2 +-
arch/blackfin/lib/ucmpdi2.S | 42 +++++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 arch/blackfin/lib/ucmpdi2.S

diff --git a/arch/blackfin/kernel/bfin_ksyms.c b/arch/blackfin/kernel/bfin_ksyms.c
index c446591..7fcfc06 100644
--- a/arch/blackfin/kernel/bfin_ksyms.c
+++ b/arch/blackfin/kernel/bfin_ksyms.c
@@ -60,6 +60,7 @@ extern void __modsi3(void);
extern void __muldi3(void);
extern void __udivsi3(void);
extern void __umodsi3(void);
+extern void __ucmpdi2(void);
EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__ashrdi3);
EXPORT_SYMBOL(__umulsi3_highpart);
@@ -70,6 +71,7 @@ EXPORT_SYMBOL(__modsi3);
EXPORT_SYMBOL(__muldi3);
EXPORT_SYMBOL(__udivsi3);
EXPORT_SYMBOL(__umodsi3);
+EXPORT_SYMBOL(__ucmpdi2);

/* Input/output symbols: lib/{in,out}s.S */
EXPORT_SYMBOL(outsb);
diff --git a/arch/blackfin/lib/Makefile b/arch/blackfin/lib/Makefile
index 42c47dc..c0b6959 100644
--- a/arch/blackfin/lib/Makefile
+++ b/arch/blackfin/lib/Makefile
@@ -4,7 +4,7 @@

lib-y := \
ashldi3.o ashrdi3.o lshrdi3.o \
- muldi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
+ muldi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o ucmpdi2.o \
memcpy.o memset.o memcmp.o memchr.o memmove.o \
strcmp.o strcpy.o strncmp.o strncpy.o \
umulsi3_highpart.o smulsi3_highpart.o \
diff --git a/arch/blackfin/lib/ucmpdi2.S b/arch/blackfin/lib/ucmpdi2.S
new file mode 100644
index 0000000..654f34c
--- /dev/null
+++ b/arch/blackfin/lib/ucmpdi2.S
@@ -0,0 +1,42 @@
+/*
+ * libgcc2 routines for Blackfin
+ *
+ * Copyright 2015 Chen Gang
+ *
+ * Licensed under the Clear BSD license or the GPL-2 (or later)
+ */
+
+#ifdef CONFIG_ARITHMETIC_OPS_L1
+.section .l1.text
+#else
+.text
+#endif
+ .align 4
+.global ___ucmpdi2;
+.type ___ucmpdi2, STT_FUNC;
+___ucmpdi2:
+ LINK 0;
+ R3 = ROT R2 BY 0 ||
+ R2 = [FP+20] ||
+ nop;
+ cc =R1<R2 (iu);
+ if cc jump .L5;
+ cc =R1<=R2 (iu);
+ if cc jump .L8;
+ UNLINK;
+ R0 = 2 (X);
+ rts;
+.L8:
+ cc =R0<R3 (iu);
+ if cc jump .L5;
+ cc =R0<=R3 (iu);
+ R1 = 1 (X);
+ R0 = 2 (X);
+ UNLINK;
+ if cc R0 = R1;
+ rts;
+.L5:
+ UNLINK;
+ R0 = 0 (X);
+ rts;
+.size ___ucmpdi2, .-___ucmpdi2
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/