1 /* SPDX-License-Identifier: GPL-2.0 */
3 * arch/alpha/lib/copy_user.S
5 * Copy to/from user space, handling exceptions as we go.. This
6 * isn't exactly pretty.
8 * This is essentially the same as "memcpy()", but with a few twists.
9 * Notably, we have to make sure that $0 is always up-to-date and
10 * contains the right "bytes left to copy" value (and that it is updated
11 * only _after_ a successful copy). There is also some rather minor
12 * exception setup stuff..
15 #include <asm/export.h>
17 /* Allow an exception for an insn; exit if we get one. */
20 .section __ex_table,"a"; \
22 lda $31, $exitin-99b($31); \
27 .section __ex_table,"a"; \
29 lda $31, $exitout-99b($31); \
45 EXI( ldq_u $1,0($17) )
46 EXO( ldq_u $2,0($16) )
52 EXO( stq_u $1,0($16) )
63 EXI( ldq_u $3,0($17) )
66 EXI( ldq_u $2,8($17) )
81 EXI( ldq_u $1,0($17) )
82 EXO( ldq_u $2,0($16) )
87 EXO( stq_u $1,0($16) )
121 EXPORT_SYMBOL(__copy_user)