1 #include <linux/linkage.h>
6 .macro fixup op reg addr lbl
10 .section __ex_table,"a"
16 ENTRY(__asm_copy_to_user)
17 ENTRY(__asm_copy_from_user)
19 /* Enable access to user memory */
24 /* Use word-oriented copy only if low-order bits match */
30 andi t1, a3, ~(SZREG-1)
31 andi t0, t0, ~(SZREG-1)
33 * a3: terminal address of source region
34 * t0: lowest XLEN-aligned address in source
35 * t1: highest XLEN-aligned address in source
40 fixup REG_L, t2, (a1), 10f
41 fixup REG_S, t2, (a0), 10f
49 /* Disable access to user memory */
53 4: /* Edge case: unalignment */
54 fixup lbu, t2, (a1), 10f
55 fixup sb, t2, (a0), 10f
60 5: /* Edge case: remainder */
61 fixup lbu, t2, (a1), 10f
62 fixup sb, t2, (a0), 10f
67 ENDPROC(__asm_copy_to_user)
68 ENDPROC(__asm_copy_from_user)
73 /* Enable access to user memory */
79 andi t1, a3, ~(SZREG-1)
80 andi t0, t0, ~(SZREG-1)
82 * a3: terminal address of target region
83 * t0: lowest doubleword-aligned address in target region
84 * t1: highest doubleword-aligned address in target region
89 fixup REG_S, zero, (a0), 11f
96 /* Disable access to user memory */
100 4: /* Edge case: unalignment */
101 fixup sb, zero, (a0), 11f
105 5: /* Edge case: remainder */
106 fixup sb, zero, (a0), 11f
110 ENDPROC(__clear_user)
114 /* Fixup code for __copy_user(10) and __clear_user(11) */
116 /* Disable access to user memory */