Commit:     9b4b8feb962f4b3e74768b7205f1f8f6cce87238
Parent:     d0c3d534a4388a465101b634a95f2ec586415254
Author:     David Gibson <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 12 12:36:20 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:13:44 2007 +1000

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
 arch/powerpc/boot/string.S |   13 +++++++++++++
 arch/powerpc/boot/string.h |    1 +
 2 files changed, 14 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
+       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
        cmpwi   0,r5,0
diff --git a/arch/powerpc/boot/string.h b/arch/powerpc/boot/string.h
index 4650030..50091cc 100644
--- a/arch/powerpc/boot/string.h
+++ b/arch/powerpc/boot/string.h
@@ -14,6 +14,7 @@ extern size_t strnlen(const char *s, size_t count);
 extern void *memset(void *s, int c, size_t n);
 extern void *memmove(void *dest, const void *src, unsigned long n);
 extern void *memcpy(void *dest, const void *src, unsigned long n);
+extern void *memchr(const void *s, int c, size_t n);
 extern int memcmp(const void *s1, const void *s2, size_t n);
 #endif /* _PPC_BOOT_STRING_H_ */
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to