From 9b4b8feb962f4b3e74768b7205f1f8f6cce87238 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 12 Oct 2007 12:36:20 +1000 Subject: [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 Signed-off-by: Paul Mackerras --- arch/powerpc/boot/string.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch/powerpc/boot/string.S') 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 -- cgit v1.1