diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-19 13:54:11 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-20 02:23:57 +0400 |
commit | de36e66d5fa52bc6e2dacd95c701a1762b5308a7 (patch) | |
tree | 16e54025bff0b92422728b8a8604dd6f2d173bac /arch/sparc/lib/ucmpdi2.c | |
parent | e1d7de8377e6ab3dbd2359507b217ea6b0944302 (diff) | |
download | linux-de36e66d5fa52bc6e2dacd95c701a1762b5308a7.tar.xz |
sparc32: add ucmpdi2
Based on copy from microblaze add ucmpdi2 implementation.
This fixes build of niu driver which failed with:
drivers/built-in.o: In function `niu_get_nfc':
niu.c:(.text+0x91494): undefined reference to `__ucmpdi2'
This driver will never be used on a sparc32 system,
but patch added to fix build breakage with all*config builds.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/lib/ucmpdi2.c')
-rw-r--r-- | arch/sparc/lib/ucmpdi2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/sparc/lib/ucmpdi2.c b/arch/sparc/lib/ucmpdi2.c new file mode 100644 index 000000000000..1e06ed500682 --- /dev/null +++ b/arch/sparc/lib/ucmpdi2.c @@ -0,0 +1,19 @@ +#include <linux/module.h> +#include "libgcc.h" + +word_type __ucmpdi2(unsigned long long a, unsigned long long b) +{ + const DWunion au = {.ll = a}; + const DWunion bu = {.ll = b}; + + if ((unsigned int) au.s.high < (unsigned int) bu.s.high) + return 0; + else if ((unsigned int) au.s.high > (unsigned int) bu.s.high) + return 2; + if ((unsigned int) au.s.low < (unsigned int) bu.s.low) + return 0; + else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) + return 2; + return 1; +} +EXPORT_SYMBOL(__ucmpdi2); |