diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-27 18:06:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-27 18:06:28 -0400 |
| commit | 5a99efeaa5c7139b7d76cbd5fb54fac664ba3da9 (patch) | |
| tree | f86488005a159beb5e7fc733b3c5ab07fadb5cc2 /arch/sparc/lib | |
| parent | 28d9aa613daa65b295a099a8433df97de1c56a2f (diff) | |
| parent | 17a82e932d67e2885d9fa18d4656ff53337b1130 (diff) | |
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')
| -rw-r--r-- | arch/sparc/lib/Makefile | 3 | ||||
| -rw-r--r-- | arch/sparc/lib/cmpdi2.c | 27 | ||||
| -rw-r--r-- | arch/sparc/lib/libgcc.h | 18 |
3 files changed, 47 insertions, 1 deletions
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 9ddc5b9ce3bd..76effdbea075 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile | |||
| @@ -8,6 +8,7 @@ lib-y := mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \ | |||
| 8 | strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \ | 8 | strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \ |
| 9 | strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \ | 9 | strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \ |
| 10 | copy_user.o locks.o atomic.o \ | 10 | copy_user.o locks.o atomic.o \ |
| 11 | lshrdi3.o ashldi3.o rwsem.o muldi3.o bitext.o | 11 | lshrdi3.o ashldi3.o rwsem.o muldi3.o bitext.o \ |
| 12 | cmpdi2.o | ||
| 12 | 13 | ||
| 13 | obj-y += iomap.o atomic32.o | 14 | obj-y += iomap.o atomic32.o |
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 @@ | |||
| 1 | #include <linux/module.h> | ||
| 2 | |||
| 3 | #include "libgcc.h" | ||
| 4 | |||
| 5 | word_type __cmpdi2(long long a, long long b) | ||
| 6 | { | ||
| 7 | const DWunion au = { | ||
| 8 | .ll = a | ||
| 9 | }; | ||
| 10 | const DWunion bu = { | ||
| 11 | .ll = b | ||
| 12 | }; | ||
| 13 | |||
| 14 | if (au.s.high < bu.s.high) | ||
| 15 | return 0; | ||
| 16 | else if (au.s.high > bu.s.high) | ||
| 17 | return 2; | ||
| 18 | |||
| 19 | if ((unsigned int) au.s.low < (unsigned int) bu.s.low) | ||
| 20 | return 0; | ||
| 21 | else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) | ||
| 22 | return 2; | ||
| 23 | |||
| 24 | return 1; | ||
| 25 | } | ||
| 26 | |||
| 27 | EXPORT_SYMBOL(__cmpdi2); | ||
diff --git a/arch/sparc/lib/libgcc.h b/arch/sparc/lib/libgcc.h new file mode 100644 index 000000000000..b84fd797f3ea --- /dev/null +++ b/arch/sparc/lib/libgcc.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef __ASM_LIBGCC_H | ||
| 2 | #define __ASM_LIBGCC_H | ||
| 3 | |||
| 4 | #include <asm/byteorder.h> | ||
| 5 | |||
| 6 | typedef int word_type __attribute__ ((mode (__word__))); | ||
| 7 | |||
| 8 | struct DWstruct { | ||
| 9 | int high, low; | ||
| 10 | }; | ||
| 11 | |||
| 12 | typedef union | ||
| 13 | { | ||
| 14 | struct DWstruct s; | ||
| 15 | long long ll; | ||
| 16 | } DWunion; | ||
| 17 | |||
| 18 | #endif /* __ASM_LIBGCC_H */ | ||
