Skip to content

Commit 10d5a92

Browse files
pelwellpopcornmix
authored andcommitted
arm: Fix custom rpi __memset32 and __memset64
See: #4798 Signed-off-by: Phil Elwell <[email protected]>
1 parent 9a81de1 commit 10d5a92

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
@@ -53,8 +53,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5353
ENTRY(mmioset)
5454
ENTRY(memset)
5555
ENTRY(__memset)
56-
ENTRY(__memset32)
57-
ENTRY(__memset64)
5856

5957
S .req a1
6058
DAT0 .req a2
@@ -64,10 +62,14 @@ ENTRY(__memset64)
6462
DAT3 .req lr
6563

6664
orr DAT0, DAT0, DAT0, lsl #8
67-
push {S, lr}
6865
orr DAT0, DAT0, DAT0, lsl #16
66+
67+
ENTRY(__memset32)
6968
mov DAT1, DAT0
7069

70+
ENTRY(__memset64)
71+
push {S, lr}
72+
7173
/* See if we're guaranteed to have at least one 16-byte aligned 16-byte write */
7274
cmp N, #31
7375
blo 170f
@@ -89,7 +91,7 @@ ENTRY(__memset64)
8991
stmcsia S!, {DAT0, DAT1}
9092
164: /* Delayed set up of DAT2 and DAT3 so we could use them as scratch registers above */
9193
mov DAT2, DAT0
92-
mov DAT3, DAT0
94+
mov DAT3, DAT1
9395
/* Now the inner loop of 16-byte stores */
9496
165: stmia S!, {DAT0, DAT1, DAT2, DAT3}
9597
subs N, N, #16
@@ -105,7 +107,7 @@ ENTRY(__memset64)
105107

106108
170: /* Short case */
107109
mov DAT2, DAT0
108-
mov DAT3, DAT0
110+
mov DAT3, DAT1
109111
tst S, #3
110112
beq 174f
111113
172: subs N, N, #1

0 commit comments

Comments
 (0)