summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/string.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/string.S')
-rw-r--r--arch/powerpc/boot/string.S24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/boot/string.S b/arch/powerpc/boot/string.S
index ac3d43b..2627558 100644
--- a/arch/powerpc/boot/string.S
+++ b/arch/powerpc/boot/string.S
@@ -49,6 +49,17 @@ strcat:
bne 1b
blr
+ .globl strchr
+strchr:
+ addi r3,r3,-1
+1: lbzu r0,1(r3)
+ cmpw 0,r0,r4
+ beqlr
+ cmpwi 0,r0,0
+ bne 1b
+ li r3,0
+ blr
+
.globl strcmp
strcmp:
addi r5,r3,-1
@@ -61,6 +72,19 @@ strcmp:
beq 1b
blr
+ .globl strncmp
+strncmp:
+ mtctr r5
+ addi r5,r3,-1
+ addi r4,r4,-1
+1: lbzu r3,1(r5)
+ cmpwi 1,r3,0
+ lbzu r0,1(r4)
+ subf. r3,r0,r3
+ beqlr 1
+ bdnzt eq,1b
+ blr
+
.globl strlen
strlen:
addi r4,r3,-1
OpenPOWER on IntegriCloud