summaryrefslogtreecommitdiff
path: root/firmware/asm
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 /firmware/asm
parent076cf0aa9bc484e9dbaee17660c2e77c16f46b13 (diff)
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
Diffstat (limited to 'firmware/asm')
-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:
/*
* we know that the pointer in r0 is aligned to a word boundary.
*/
+ and r1, r1, #255 @ clear sign bits
orr r1, r1, r1, lsl #8
orr r1, r1, r1, lsl #16
mov r3, r1