2 * Copyright 2005-2010 Analog Devices Inc.
4 * Licensed under the ADI BSD license or the GPL-2 (or later)
7 #include <linux/linkage.h>
9 /* void *strncpy(char *s1, const char *s2, size_t n);
13 * Returns a pointer to the destination string dest
16 #ifdef CONFIG_STRNCMP_L1
31 R0 = B[P0++] (Z); /* get *s1 */
32 R1 = B[P1++] (Z); /* get *s2 */
33 CC = R0 == R1; /* compare a byte */
34 if ! cc jump 3f; /* not equal, break out */
35 CC = R0; /* at end of s1? */
36 if ! cc jump 4f; /* yes, all done */
37 R2 += -1; /* no, adjust count */
39 if ! cc jump 1b (bp); /* more to do, keep going */
41 R0 = 0; /* strings are equal */
44 R0 = R0 - R1; /* *s1 - *s2 */