Skip to content

Commit

Permalink
arm64: Treat the bitops index argument as an 'int'
Browse files Browse the repository at this point in the history
The bitops prototype use an 'int' as the bit index type but the asm
implementation assume it to be a 'long'. Since the compiler does not
guarantee zeroing the upper 32-bits in a register when used as 'int',
change the bitops implementation accordingly.

Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
ctmarinas committed May 8, 2013
1 parent 0e7f7bc commit 420c158
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/arm64/lib/bitops.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

/*
* x0: bits 5:0 bit offset
* bits 63:6 word offset
* bits 31:6 word offset
* x1: address
*/
.macro bitop, name, instr
ENTRY( \name )
and x3, x0, #63 // Get bit offset
eor x0, x0, x3 // Clear low bits
and w3, w0, #63 // Get bit offset
eor w0, w0, w3 // Clear low bits
mov x2, #1
add x1, x1, x0, lsr #3 // Get word offset
lsl x3, x2, x3 // Create mask
Expand All @@ -41,8 +41,8 @@ ENDPROC(\name )

.macro testop, name, instr
ENTRY( \name )
and x3, x0, #63 // Get bit offset
eor x0, x0, x3 // Clear low bits
and w3, w0, #63 // Get bit offset
eor w0, w0, w3 // Clear low bits
mov x2, #1
add x1, x1, x0, lsr #3 // Get word offset
lsl x4, x2, x3 // Create mask
Expand Down

0 comments on commit 420c158

Please sign in to comment.