summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/string.S
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-10-12 12:36:20 +1000
committerPaul Mackerras <paulus@samba.org>2007-10-12 14:13:44 +1000
commit9b4b8feb962f4b3e74768b7205f1f8f6cce87238 (patch)
tree7d7c95d9024d0d47ebb5f4299efc8d7ef00fa3ec /arch/powerpc/boot/string.S
parentd0c3d534a4388a465101b634a95f2ec586415254 (diff)
downloadop-kernel-dev-9b4b8feb962f4b3e74768b7205f1f8f6cce87238.zip
op-kernel-dev-9b4b8feb962f4b3e74768b7205f1f8f6cce87238.tar.gz
[POWERPC] Add memchr() to the bootwrapper
This adds a memchr() implementation to the bootwrapper, which will be needed when libfdt is merged in. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
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 2627558..643e4cb 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
OpenPOWER on IntegriCloud