diff options
Diffstat (limited to 'arch/powerpc/boot/string.S')
-rw-r--r-- | arch/powerpc/boot/string.S | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/powerpc/boot/string.S b/arch/powerpc/boot/string.S index ac3d43b6a324..643e4cb2f11d 100644 --- a/arch/powerpc/boot/string.S +++ b/arch/powerpc/boot/string.S | |||
@@ -49,6 +49,17 @@ strcat: | |||
49 | bne 1b | 49 | bne 1b |
50 | blr | 50 | blr |
51 | 51 | ||
52 | .globl strchr | ||
53 | strchr: | ||
54 | addi r3,r3,-1 | ||
55 | 1: lbzu r0,1(r3) | ||
56 | cmpw 0,r0,r4 | ||
57 | beqlr | ||
58 | cmpwi 0,r0,0 | ||
59 | bne 1b | ||
60 | li r3,0 | ||
61 | blr | ||
62 | |||
52 | .globl strcmp | 63 | .globl strcmp |
53 | strcmp: | 64 | strcmp: |
54 | addi r5,r3,-1 | 65 | addi r5,r3,-1 |
@@ -61,6 +72,19 @@ strcmp: | |||
61 | beq 1b | 72 | beq 1b |
62 | blr | 73 | blr |
63 | 74 | ||
75 | .globl strncmp | ||
76 | strncmp: | ||
77 | mtctr r5 | ||
78 | addi r5,r3,-1 | ||
79 | addi r4,r4,-1 | ||
80 | 1: lbzu r3,1(r5) | ||
81 | cmpwi 1,r3,0 | ||
82 | lbzu r0,1(r4) | ||
83 | subf. r3,r0,r3 | ||
84 | beqlr 1 | ||
85 | bdnzt eq,1b | ||
86 | blr | ||
87 | |||
64 | .globl strlen | 88 | .globl strlen |
65 | strlen: | 89 | strlen: |
66 | addi r4,r3,-1 | 90 | addi r4,r3,-1 |
@@ -195,6 +219,19 @@ backwards_memcpy: | |||
195 | mtctr r7 | 219 | mtctr r7 |
196 | b 1b | 220 | b 1b |
197 | 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 | |||
198 | .globl memcmp | 235 | .globl memcmp |
199 | memcmp: | 236 | memcmp: |
200 | cmpwi 0,r5,0 | 237 | cmpwi 0,r5,0 |