2 * Copyright 2005-2010 Analog Devices Inc.
4 * Licensed under the Clear BSD license or the GPL-2 (or later)
7 #include <linux/linkage.h>
8 #include <asm/context.S>
10 /* void *strncpy(char *dest, const char *src, size_t n);
14 * Returns a pointer (R0) to the destination string dest
15 * we do this by not changing R0
18 #ifdef CONFIG_STRNCPY_L1
34 LSETUP (1f, 2f) LC0 = P2;
44 /* if src is shorter than n, we need to null pad bytes in dest
45 * but, we can get here when the last byte is zero, and we don't
46 * want to copy an extra byte at the end, so we need to check
53 /* if the required null padded portion is small, do it here, rather than
54 * handling the overhead of memset (which is OK when things are big).
62 /* Set things up for memset
64 * R1 = filler byte (this case it's zero, set above)
65 * R2 = count (set above)
72 pseudo_long_call _memset, p0;