Skip to content

Commit

Permalink
powerpc: Fix div64 in bootloader
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt committed Nov 18, 2010
1 parent 7957f0a commit acbfd58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/boot/div64.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit acbfd58

Please sign in to comment.