Robin Getz | 479ba60 | 2010-05-03 17:23:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2005-2010 Analog Devices Inc. |
| 3 | * |
Sonic Zhang | de45083 | 2012-05-17 14:45:27 +0800 | [diff] [blame] | 4 | * Licensed under the Clear BSD license or the GPL-2 (or later) |
Robin Getz | 479ba60 | 2010-05-03 17:23:20 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <linux/linkage.h> |
| 8 | |
| 9 | /* void *strcpy(char *dest, const char *src); |
| 10 | * R0 = address (dest) |
| 11 | * R1 = address (src) |
| 12 | * |
| 13 | * Returns a pointer to the destination string dest |
| 14 | */ |
| 15 | |
| 16 | #ifdef CONFIG_STRCPY_L1 |
| 17 | .section .l1.text |
| 18 | #else |
| 19 | .text |
| 20 | #endif |
| 21 | |
| 22 | .align 2 |
| 23 | |
| 24 | ENTRY(_strcpy) |
| 25 | P0 = R0 ; /* dst*/ |
| 26 | P1 = R1 ; /* src*/ |
| 27 | |
| 28 | 1: |
| 29 | R1 = B [P1++] (Z); |
| 30 | B [P0++] = R1; |
| 31 | CC = R1; |
| 32 | if cc jump 1b (bp); |
| 33 | RTS; |
| 34 | |
| 35 | ENDPROC(_strcpy) |