summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/string.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/string.S')
-rw-r--r--arch/powerpc/boot/string.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/boot/string.S b/arch/powerpc/boot/string.S
index 2627558bcb7..643e4cb2f11 100644
--- a/arch/powerpc/boot/string.S
+++ b/arch/powerpc/boot/string.S
@@ -219,6 +219,19 @@ backwards_memcpy:
mtctr r7
b 1b
+ .globl memchr
+memchr:
+ cmpwi 0,r5,0
+ blelr
+ mtctr r5
+ addi r3,r3,-1
+1: lbzu r0,1(r3)
+ cmpw r0,r4
+ beqlr
+ bdnz 1b
+ li r3,0
+ blr
+
.globl memcmp
memcmp:
cmpwi 0,r5,0