summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2017-07-27 00:00:51 -0400
committerFranklin Wei <git@fwei.tk>2017-07-27 19:09:50 -0400
commitc2546d31876598c390e8c8e3f6ebeb79d1849462 (patch)
treeada474ed9c7d084e7639aa26d5b2b125a17484ab
parent076cf0aa9bc484e9dbaee17660c2e77c16f46b13 (diff)
downloadrockbox-c2546d31876598c390e8c8e3f6ebeb79d1849462.tar.gz
rockbox-c2546d31876598c390e8c8e3f6ebeb79d1849462.zip
Fix arm memset() handling of negative arguments
This fixes the sgt-mines plugin. Same issue was present in an old glibc as well: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a7ed1adbecb6aac49af75aae3b3498798cf63abc
-rw-r--r--firmware/asm/arm/memset.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/asm/arm/memset.S b/firmware/asm/arm/memset.S
index 682da874ce..64cd95cc9e 100644
--- a/firmware/asm/arm/memset.S
+++ b/firmware/asm/arm/memset.S
@@ -50,6 +50,7 @@ memset:
50/* 50/*
51 * we know that the pointer in r0 is aligned to a word boundary. 51 * we know that the pointer in r0 is aligned to a word boundary.
52 */ 52 */
53 and r1, r1, #255 @ clear sign bits
53 orr r1, r1, r1, lsl #8 54 orr r1, r1, r1, lsl #8
54 orr r1, r1, r1, lsl #16 55 orr r1, r1, r1, lsl #16
55 mov r3, r1 56 mov r3, r1