aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/misc_32.S
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-03-12 18:39:55 -0400
committerPaul Mackerras <paulus@samba.org>2008-03-12 18:39:55 -0400
commit95ff54f5176a36f65522e46c670a571728328b10 (patch)
treeab569ddca890ff70c4770e4376f119355c042695 /arch/powerpc/kernel/misc_32.S
parent9cf7f7fac8c36e54e4869fc01e1bad0d3b4de53b (diff)
[POWERPC] Add __ucmpdi2 for 64-bit comparisons in 32-bit kernels
Some drivers (such as V4L2) have code that causes gcc to generate calls to __ucmpdi2 when compiling for 32-bit powerpc, which results in either a link-time error or a module that can't be loaded, as we don't currently have a __ucmpdi2. This adds one so these drivers can be used. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/misc_32.S')
-rw-r--r--arch/powerpc/kernel/misc_32.S15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 5c2e253ddfb1..9d2c56621f1e 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -785,6 +785,21 @@ _GLOBAL(__lshrdi3)
785 or r4,r4,r7 # LSW |= t2 785 or r4,r4,r7 # LSW |= t2
786 blr 786 blr
787 787
788/*
789 * 64-bit comparison: __ucmpdi2(u64 a, u64 b)
790 * Returns 0 if a < b, 1 if a == b, 2 if a > b.
791 */
792_GLOBAL(__ucmpdi2)
793 cmplw r3,r5
794 li r3,1
795 bne 1f
796 cmplw r4,r6
797 beqlr
7981: li r3,0
799 bltlr
800 li r3,2
801 blr
802
788_GLOBAL(abs) 803_GLOBAL(abs)
789 srawi r4,r3,31 804 srawi r4,r3,31
790 xor r3,r3,r4 805 xor r3,r3,r4