2 * arch/alpha/lib/copy_user.S
4 * Copy to/from user space, handling exceptions as we go.. This
5 * isn't exactly pretty.
7 * This is essentially the same as "memcpy()", but with a few twists.
8 * Notably, we have to make sure that $0 is always up-to-date and
9 * contains the right "bytes left to copy" value (and that it is updated
10 * only _after_ a successful copy). There is also some rather minor
11 * exception setup stuff..
13 * NOTE! This is not directly C-callable, because the calling semantics are
18 * destination address in $6
19 * source address in $7
20 * return address in $28
23 * bytes left to copy in $0
26 * $1,$2,$3,$4,$5,$6,$7
29 /* Allow an exception for an insn; exit if we get one. */
32 .section __ex_table,"a"; \
34 lda $31, $exitin-99b($31); \
39 .section __ex_table,"a"; \
41 lda $31, $exitout-99b($31); \
131 /* A stupid byte-by-byte zeroing of the rest of the output
132 buffer. This cures security holes by never leaving
133 random kernel data around to be copied elsewhere. */
137 EXO ( ldq_u $2,0($6) )
140 EXO ( stq_u $2,0($6) )