Skip to content

Commit

Permalink
ARM: 6006/1: ARM: Use the correct NOP size in memmove for Thumb-2 ker…
Browse files Browse the repository at this point in the history
…nel builds

When compiling the kernel to Thumb-2, using a 16-bit NOP in the
memmove() implementation causes the preceding ADD PC instruction to
branch incorrectly in the middle of a 32-bit LDR or STR instruction. The
memmove() code is now similar to the memcpy() template.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Catalin Marinas authored and Russell King committed Mar 29, 2010
1 parent 782a0fd commit fd522a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/lib/memmove.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ENTRY(memmove)
rsb ip, ip, #32
addne pc, pc, ip @ C is always clear here
b 7f
6: nop
6: W(nop)
W(ldr) r3, [r1, #-4]!
W(ldr) r4, [r1, #-4]!
W(ldr) r5, [r1, #-4]!
Expand All @@ -85,7 +85,7 @@ ENTRY(memmove)

add pc, pc, ip
nop
nop
W(nop)
W(str) r3, [r0, #-4]!
W(str) r4, [r0, #-4]!
W(str) r5, [r0, #-4]!
Expand Down

0 comments on commit fd522a8

Please sign in to comment.