diff options
| author | Linus Torvalds <[email protected]> | 2007-08-27 22:06:28 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-08-27 22:06:28 +0000 |
| commit | 5a99efeaa5c7139b7d76cbd5fb54fac664ba3da9 (patch) | |
| tree | f86488005a159beb5e7fc733b3c5ab07fadb5cc2 /arch/sparc/lib/cmpdi2.c | |
| parent | Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/ne... (diff) | |
| parent | [SPARC32]: Make flush_tlb_kernel_range() an inline function. (diff) | |
| download | kernel-5a99efeaa5c7139b7d76cbd5fb54fac664ba3da9.tar.gz kernel-5a99efeaa5c7139b7d76cbd5fb54fac664ba3da9.zip | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC32]: Make flush_tlb_kernel_range() an inline function.
[SERIAL]: Fix 32-bit warnings in sunzilog.c and sunsu.c
[SPARC32]: Kill unused vars and macros from prom/console.c
[SPARC32]: Add __cmpdi2() libcall implementation ala. MIPS.
[VIDEO]: Do not prom_halt() in cg3 and bw2 device probe.
[SUNVDC]: Use slice 0xff on VD_DISK_TYPE_DISK.
Diffstat (limited to 'arch/sparc/lib/cmpdi2.c')
| -rw-r--r-- | arch/sparc/lib/cmpdi2.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/sparc/lib/cmpdi2.c b/arch/sparc/lib/cmpdi2.c new file mode 100644 index 000000000000..8c1306437ed1 --- /dev/null +++ b/arch/sparc/lib/cmpdi2.c @@ -0,0 +1,27 @@ +#include <linux/module.h> + +#include "libgcc.h" + +word_type __cmpdi2(long long a, long long b) +{ + const DWunion au = { + .ll = a + }; + const DWunion bu = { + .ll = b + }; + + if (au.s.high < bu.s.high) + return 0; + else if (au.s.high > 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(__cmpdi2); |
