1 #include <linux/linkage.h>
2 #include <asm-generic/export.h>
6 .macro fixup op reg addr lbl
9 .section __ex_table,"a"
15 ENTRY(__asm_copy_to_user)
16 ENTRY(__asm_copy_from_user)
18 /* Enable access to user memory */
23 /* Use word-oriented copy only if low-order bits match */
29 andi t1, a3, ~(SZREG-1)
30 andi t0, t0, ~(SZREG-1)
32 * a3: terminal address of source region
33 * t0: lowest XLEN-aligned address in source
34 * t1: highest XLEN-aligned address in source
39 fixup REG_L, t2, (a1), 10f
40 fixup REG_S, t2, (a0), 10f
48 /* Disable access to user memory */
52 4: /* Edge case: unalignment */
53 fixup lbu, t2, (a1), 10f
54 fixup sb, t2, (a0), 10f
59 5: /* Edge case: remainder */
60 fixup lbu, t2, (a1), 10f
61 fixup sb, t2, (a0), 10f
66 ENDPROC(__asm_copy_to_user)
67 ENDPROC(__asm_copy_from_user)
68 EXPORT_SYMBOL(__asm_copy_to_user)
69 EXPORT_SYMBOL(__asm_copy_from_user)
74 /* Enable access to user memory */
80 andi t1, a3, ~(SZREG-1)
81 andi t0, t0, ~(SZREG-1)
83 * a3: terminal address of target region
84 * t0: lowest doubleword-aligned address in target region
85 * t1: highest doubleword-aligned address in target region
90 fixup REG_S, zero, (a0), 11f
97 /* Disable access to user memory */
101 4: /* Edge case: unalignment */
102 fixup sb, zero, (a0), 11f
106 5: /* Edge case: remainder */
107 fixup sb, zero, (a0), 11f
111 ENDPROC(__clear_user)
112 EXPORT_SYMBOL(__clear_user)
116 /* Fixup code for __copy_user(10) and __clear_user(11) */
118 /* Disable access to user memory */