Erm we can't change the value of arm_memcpy if we're running from flash.

Instead, make memcpy() check if we're running from flash, and avoid
using arm_memcpy if we're doing so.
This commit is contained in:
Olivier Houchard 2007-02-26 02:03:48 +00:00
parent b5ea8f4cbc
commit f96b290333
2 changed files with 23 additions and 5 deletions

View File

@ -95,11 +95,6 @@ do_copy:
sub r0, r0, r9
add r0, r0, r8
mov r4, r0
/* Make sure _arm_memcpy is NULL */
ldr r3, .L_arm_memcpy
ldr r3, [r3]
mov r5, #0
str r5, [r3]
bl memcpy
ldr r0, Lram_offset
add pc, r4, r0

View File

@ -871,6 +871,18 @@ ENTRY(memmove)
#if !defined(__XSCALE__)
ENTRY(memcpy)
/* save leaf functions having to store this away */
/* Do not check arm_memcpy if we're running from flash */
#ifdef FLASHADDR
#if FLASHADDR > PHYSADDR
ldr r3, =FLASHADDR
cmp r3, pc
bls .Lnormal
#else
ldr r3, =FLASHADDR
cmp r3, pc
bhi .Lnormal
#endif
#endif
ldr r3, .L_arm_memcpy
ldr r3, [r3]
cmp r3, #0
@ -1096,6 +1108,17 @@ ENTRY(memcpy)
pld [r1]
cmp r2, #0x0c
ble .Lmemcpy_short /* <= 12 bytes */
#ifdef FLASHADDR
#if FLASHADDR > PHYSADDR
ldr r3, =FLASHADDR
cmp r3, pc
bls .Lnormal
#else
ldr r3, =FLASHADDR
cmp r3, pc
bhi .Lnormal
#endif
#endif
ldr r3, .L_arm_memcpy
ldr r3, [r3]
cmp r3, #0