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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167003
2 changed files with 23 additions and 5 deletions

View File

@ -95,11 +95,6 @@ do_copy:
sub r0, r0, r9 sub r0, r0, r9
add r0, r0, r8 add r0, r0, r8
mov r4, r0 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 bl memcpy
ldr r0, Lram_offset ldr r0, Lram_offset
add pc, r4, r0 add pc, r4, r0

View File

@ -871,6 +871,18 @@ ENTRY(memmove)
#if !defined(__XSCALE__) #if !defined(__XSCALE__)
ENTRY(memcpy) ENTRY(memcpy)
/* save leaf functions having to store this away */ /* 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, .L_arm_memcpy
ldr r3, [r3] ldr r3, [r3]
cmp r3, #0 cmp r3, #0
@ -1096,6 +1108,17 @@ ENTRY(memcpy)
pld [r1] pld [r1]
cmp r2, #0x0c cmp r2, #0x0c
ble .Lmemcpy_short /* <= 12 bytes */ 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, .L_arm_memcpy
ldr r3, [r3] ldr r3, [r3]
cmp r3, #0 cmp r3, #0