aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2016-07-26 18:21:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 19:19:19 -0400
commita44ce52363a886d45cf08b4b896cb65f0a9553eb (patch)
tree55c0e3736ac6d94f64fa0916fee24a80e3919056
parent8cde0daf6c4cca8babec4861a1ce7f8875edf879 (diff)
m32r: add __ucmpdi2 to fix build failure
We are having build failure with m32r and the error message being: ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined! ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined! ERROR: "__ucmpdi2" [drivers/scsi/sd_mod.ko] undefined! ERROR: "__ucmpdi2" [drivers/media/i2c/adv7842.ko] undefined! ERROR: "__ucmpdi2" [drivers/md/bcache/bcache.ko] undefined! ERROR: "__ucmpdi2" [drivers/iio/imu/inv_mpu6050/inv-mpu6050.ko] undefined! __ucmpdi2 is introduced to m32r architecture taking example from other architectures like h8300, microblaze, mips. Link: http://lkml.kernel.org/r/1465509213-4280-1-git-send-email-sudipm.mukherjee@gmail.com Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/m32r/kernel/m32r_ksyms.c3
-rw-r--r--arch/m32r/lib/Makefile4
-rw-r--r--arch/m32r/lib/libgcc.h23
-rw-r--r--arch/m32r/lib/ucmpdi2.c17
4 files changed, 45 insertions, 2 deletions
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c
index b727e693c805..23f26f4adfff 100644
--- a/arch/m32r/kernel/m32r_ksyms.c
+++ b/arch/m32r/kernel/m32r_ksyms.c
@@ -41,6 +41,9 @@ EXPORT_SYMBOL(cpu_data);
41EXPORT_SYMBOL(smp_flush_tlb_page); 41EXPORT_SYMBOL(smp_flush_tlb_page);
42#endif 42#endif
43 43
44extern int __ucmpdi2(unsigned long long a, unsigned long long b);
45EXPORT_SYMBOL(__ucmpdi2);
46
44/* compiler generated symbol */ 47/* compiler generated symbol */
45extern void __ashldi3(void); 48extern void __ashldi3(void);
46extern void __ashrdi3(void); 49extern void __ashrdi3(void);
diff --git a/arch/m32r/lib/Makefile b/arch/m32r/lib/Makefile
index d16b4e40d1ae..5889eb9610b5 100644
--- a/arch/m32r/lib/Makefile
+++ b/arch/m32r/lib/Makefile
@@ -3,5 +3,5 @@
3# 3#
4 4
5lib-y := checksum.o ashxdi3.o memset.o memcpy.o \ 5lib-y := checksum.o ashxdi3.o memset.o memcpy.o \
6 delay.o strlen.o usercopy.o csum_partial_copy.o 6 delay.o strlen.o usercopy.o csum_partial_copy.o \
7 7 ucmpdi2.o
diff --git a/arch/m32r/lib/libgcc.h b/arch/m32r/lib/libgcc.h
new file mode 100644
index 000000000000..267aa435bc35
--- /dev/null
+++ b/arch/m32r/lib/libgcc.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_LIBGCC_H
2#define __ASM_LIBGCC_H
3
4#include <asm/byteorder.h>
5
6#ifdef __BIG_ENDIAN
7struct DWstruct {
8 int high, low;
9};
10#elif defined(__LITTLE_ENDIAN)
11struct DWstruct {
12 int low, high;
13};
14#else
15#error I feel sick.
16#endif
17
18typedef union {
19 struct DWstruct s;
20 long long ll;
21} DWunion;
22
23#endif /* __ASM_LIBGCC_H */
diff --git a/arch/m32r/lib/ucmpdi2.c b/arch/m32r/lib/ucmpdi2.c
new file mode 100644
index 000000000000..9d3c682c89b5
--- /dev/null
+++ b/arch/m32r/lib/ucmpdi2.c
@@ -0,0 +1,17 @@
1#include "libgcc.h"
2
3int __ucmpdi2(unsigned long long a, unsigned long long b)
4{
5 const DWunion au = {.ll = a};
6 const DWunion bu = {.ll = b};
7
8 if ((unsigned int)au.s.high < (unsigned int)bu.s.high)
9 return 0;
10 else if ((unsigned int)au.s.high > (unsigned int)bu.s.high)
11 return 2;
12 if ((unsigned int)au.s.low < (unsigned int)bu.s.low)
13 return 0;
14 else if ((unsigned int)au.s.low > (unsigned int)bu.s.low)
15 return 2;
16 return 1;
17}