[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>
This commit is contained in:
David Gibson
2007-10-12 12:36:20 +10:00
committed by Paul Mackerras
parent d0c3d534a4
commit 9b4b8feb96
2 changed files with 14 additions and 0 deletions

View File

@@ -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