blob: 8b65d7c4727b280ee30b406a1091642683369f04 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001;;; SPDX-License-Identifier: GPL-2.0
2;;; strncpy.S
3
4#include <asm/linkage.h>
5
6 .text
7.global strncpy_from_user
8
9;;; long strncpy_from_user(void *to, void *from, size_t n)
10strncpy_from_user:
11 mov.l er2,er2
12 bne 1f
13 sub.l er0,er0
14 rts
151:
16 mov.l er4,@-sp
17 sub.l er3,er3
182:
19 mov.b @er1+,r4l
20 mov.b r4l,@er0
21 adds #1,er0
22 beq 3f
23 inc.l #1,er3
24 dec.l #1,er2
25 bne 2b
263:
27 dec.l #1,er2
284:
29 mov.b r4l,@er0
30 adds #1,er0
31 dec.l #1,er2
32 bne 4b
33 mov.l er3,er0
34 mov.l @sp+,er4
35 rts