Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / arch / powerpc / lib / string.S
index b9ca84e..49eb1f1 100644 (file)
@@ -8,7 +8,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/errno.h>
 #include <asm/ppc_asm.h>
@@ -76,6 +75,20 @@ _GLOBAL(strcmp)
        beq     1b
        blr
 
+_GLOBAL(strncmp)
+       PPC_LCMPI r5,0
+       beqlr
+       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
+
 _GLOBAL(strlen)
        addi    r4,r3,-1
 1:     lbzu    r0,1(r4)