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