Skip to content

Commit d23b69f

Browse files
committed
arm: Fix custom rpi __memset32 and __memset64
See: #4798 Signed-off-by: Phil Elwell <[email protected]>
1 parent 54bf82c commit d23b69f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

arch/arm/lib/memset_rpi.S

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5252
*/
5353
ENTRY(mmioset)
5454
ENTRY(memset)
55-
ENTRY(__memset32)
56-
ENTRY(__memset64)
5755

5856
S .req a1
5957
DAT0 .req a2
@@ -63,10 +61,14 @@ ENTRY(__memset64)
6361
DAT3 .req lr
6462

6563
orr DAT0, DAT0, DAT0, lsl #8
66-
push {S, lr}
6764
orr DAT0, DAT0, DAT0, lsl #16
65+
66+
ENTRY(__memset32)
6867
mov DAT1, DAT0
6968

69+
ENTRY(__memset64)
70+
push {S, lr}
71+
7072
/* See if we're guaranteed to have at least one 16-byte aligned 16-byte write */
7173
cmp N, #31
7274
blo 170f
@@ -88,7 +90,7 @@ ENTRY(__memset64)
8890
stmcsia S!, {DAT0, DAT1}
8991
164: /* Delayed set up of DAT2 and DAT3 so we could use them as scratch registers above */
9092
mov DAT2, DAT0
91-
mov DAT3, DAT0
93+
mov DAT3, DAT1
9294
/* Now the inner loop of 16-byte stores */
9395
165: stmia S!, {DAT0, DAT1, DAT2, DAT3}
9496
subs N, N, #16
@@ -104,7 +106,7 @@ ENTRY(__memset64)
104106

105107
170: /* Short case */
106108
mov DAT2, DAT0
107-
mov DAT3, DAT0
109+
mov DAT3, DAT1
108110
tst S, #3
109111
beq 174f
110112
172: subs N, N, #1

0 commit comments

Comments
 (0)