summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-11-18 14:39:24 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-11-18 14:39:24 +1100
commitacbfd58e8a1f24ef644a90a90825c3f435b990f5 (patch)
tree8dc0e5cbfe08a8a4caa696335bd46b3be2d85d20 /arch
parent7957f0a857754c555e07f58a3fb83ac29501478c (diff)
downloadlinux-acbfd58e8a1f24ef644a90a90825c3f435b990f5.tar.bz2
powerpc: Fix div64 in bootloader
The code is missing a fix that went into the main kernel variant (we should try to share that code again at some stage) Reported-by: Albert Cahalan <acahalan@gmail.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/boot/div64.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/boot/div64.S b/arch/powerpc/boot/div64.S
index 722f360a32a9..d271ab542673 100644
--- a/arch/powerpc/boot/div64.S
+++ b/arch/powerpc/boot/div64.S
@@ -33,9 +33,10 @@ __div64_32:
cntlzw r0,r5 # we are shifting the dividend right
li r10,-1 # to make it < 2^32, and shifting
srw r10,r10,r0 # the divisor right the same amount,
- add r9,r4,r10 # rounding up (so the estimate cannot
+ addc r9,r4,r10 # rounding up (so the estimate cannot
andc r11,r6,r10 # ever be too large, only too small)
andc r9,r9,r10
+ addze r9,r9
or r11,r5,r11
rotlw r9,r9,r0
rotlw r11,r11,r0