1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* copy_in_user.S: Copy from userspace to userspace.
4 * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
7 #include <linux/linkage.h>
9 #include <asm/export.h>
15 .section __ex_table,"a";\
21 #define EX_O4(x,y) EX(x,y,__retl_o4_plus_8)
22 #define EX_O2_4(x,y) EX(x,y,__retl_o2_plus_4)
23 #define EX_O2_1(x,y) EX(x,y,__retl_o2_plus_1)
25 .register %g2,#scratch
26 .register %g3,#scratch
42 /* Don't try to get too fancy here, just nice and
43 * simple. This is predominantly used for well aligned
44 * small copies in the compat layer. It is also used
45 * to copy register windows around during thread cloning.
48 ENTRY(raw_copy_in_user) /* %o0=dst, %o1=src, %o2=len */
63 1: subcc %o4, 0x8, %o4
64 EX_O4(ldxa [%o1] %asi, %o5)
65 EX_O4(stxa %o5, [%o0] %asi)
73 EX_O2_4(lduwa [%o1] %asi, %o5)
74 EX_O2_4(stwa %o5, [%o0] %asi)
83 80: /* 0 < len <= 16 */
90 EX_O2_4(lduwa [%o1] %asi, %g1)
91 EX_O2_4(stwa %g1, [%o0] %asi)
102 EX_O2_1(lduba [%o1] %asi, %g1)
103 EX_O2_1(stba %g1, [%o0] %asi)
109 ENDPROC(raw_copy_in_user)
110 EXPORT_SYMBOL(raw_copy_in_user)