diff options
-rw-r--r-- | arch/powerpc/boot/string.S | 13 | ||||
-rw-r--r-- | 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 2627558bcb71..643e4cb2f11d 100644 --- a/arch/powerpc/boot/string.S +++ b/arch/powerpc/boot/string.S | |||
@@ -219,6 +219,19 @@ backwards_memcpy: | |||
219 | mtctr r7 | 219 | mtctr r7 |
220 | b 1b | 220 | b 1b |
221 | 221 | ||
222 | .globl memchr | ||
223 | memchr: | ||
224 | cmpwi 0,r5,0 | ||
225 | blelr | ||
226 | mtctr r5 | ||
227 | addi r3,r3,-1 | ||
228 | 1: lbzu r0,1(r3) | ||
229 | cmpw r0,r4 | ||
230 | beqlr | ||
231 | bdnz 1b | ||
232 | li r3,0 | ||
233 | blr | ||
234 | |||
222 | .globl memcmp | 235 | .globl memcmp |
223 | memcmp: | 236 | memcmp: |
224 | cmpwi 0,r5,0 | 237 | cmpwi 0,r5,0 |
diff --git a/arch/powerpc/boot/string.h b/arch/powerpc/boot/string.h index 4650030d1040..50091cc0eed9 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); | |||
14 | extern void *memset(void *s, int c, size_t n); | 14 | extern void *memset(void *s, int c, size_t n); |
15 | extern void *memmove(void *dest, const void *src, unsigned long n); | 15 | extern void *memmove(void *dest, const void *src, unsigned long n); |
16 | extern void *memcpy(void *dest, const void *src, unsigned long n); | 16 | extern void *memcpy(void *dest, const void *src, unsigned long n); |
17 | extern void *memchr(const void *s, int c, size_t n); | ||
17 | extern int memcmp(const void *s1, const void *s2, size_t n); | 18 | extern int memcmp(const void *s1, const void *s2, size_t n); |
18 | 19 | ||
19 | #endif /* _PPC_BOOT_STRING_H_ */ | 20 | #endif /* _PPC_BOOT_STRING_H_ */ |