aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/string.S
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-08-28 00:52:57 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-13 11:33:19 -0400
commit0ae0b54565a8dcc2b98de694b998e765de15b713 (patch)
tree21bbfa5618d55460e2e90ef0e876b1c6c03b42f7 /arch/powerpc/boot/string.S
parent768cc2d3b2768ca34f254e8190f1f9e297b09ad4 (diff)
[POWERPC] Move bootwrapper's strchr() and strncmp() from .h to string.S
Currently the bootwrapper has implementations of strchr() and strncmp(), but they're inlines in flatdevtree_env.h, rather than in string.S with all the rest of the string functions. This moves them to string.S. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
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 ac3d43b6a32..2627558bcb7 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
53strchr:
54 addi r3,r3,-1
551: 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
53strcmp: 64strcmp:
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
76strncmp:
77 mtctr r5
78 addi r5,r3,-1
79 addi r4,r4,-1
801: 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
65strlen: 89strlen:
66 addi r4,r3,-1 90 addi r4,r3,-1