diff options
Diffstat (limited to 'arch/sparc/lib')
-rw-r--r-- | arch/sparc/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/sparc/lib/ucmpdi2.c | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index ead6df25054c..245bccfbe7e6 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile | |||
@@ -15,7 +15,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o | |||
15 | lib-$(CONFIG_SPARC32) += copy_user.o locks.o | 15 | lib-$(CONFIG_SPARC32) += copy_user.o locks.o |
16 | lib-$(CONFIG_SPARC64) += atomic_64.o | 16 | lib-$(CONFIG_SPARC64) += atomic_64.o |
17 | lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o | 17 | lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o |
18 | lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o | 18 | lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o ucmpdi2.o |
19 | 19 | ||
20 | lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o | 20 | lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o |
21 | lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o | 21 | lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o |
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 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include "libgcc.h" | ||
3 | |||
4 | word_type __ucmpdi2(unsigned long long a, unsigned long long b) | ||
5 | { | ||
6 | const DWunion au = {.ll = a}; | ||
7 | const DWunion bu = {.ll = b}; | ||
8 | |||
9 | if ((unsigned int) au.s.high < (unsigned int) bu.s.high) | ||
10 | return 0; | ||
11 | else if ((unsigned int) au.s.high > (unsigned int) bu.s.high) | ||
12 | return 2; | ||
13 | if ((unsigned int) au.s.low < (unsigned int) bu.s.low) | ||
14 | return 0; | ||
15 | else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) | ||
16 | return 2; | ||
17 | return 1; | ||
18 | } | ||
19 | EXPORT_SYMBOL(__ucmpdi2); | ||