/*1* Copyright 2005-2010 Analog Devices Inc.2*3* Licensed under the ADI BSD license or the GPL-2 (or later)4*/56#include <linux/linkage.h>78/* void *strncpy(char *s1, const char *s2, size_t n);9* R0 = address (dest)10* R1 = address (src)11* R2 = size (n)12* Returns a pointer to the destination string dest13*/1415#ifdef CONFIG_STRNCMP_L116.section .l1.text17#else18.text19#endif2021.align 22223ENTRY(_strncmp)24CC = R2 == 0;25if CC JUMP 5f;2627P0 = R0 ; /* s1 */28P1 = R1 ; /* s2 */291:30R0 = B[P0++] (Z); /* get *s1 */31R1 = B[P1++] (Z); /* get *s2 */32CC = R0 == R1; /* compare a byte */33if ! cc jump 3f; /* not equal, break out */34CC = R0; /* at end of s1? */35if ! cc jump 4f; /* yes, all done */36R2 += -1; /* no, adjust count */37CC = R2 == 0;38if ! cc jump 1b (bp); /* more to do, keep going */392:40R0 = 0; /* strings are equal */41jump.s 4f;423:43R0 = R0 - R1; /* *s1 - *s2 */444:45RTS;46475:48R0 = 0;49RTS;5051ENDPROC(_strncmp)525354