1 #include <linux/linkage.h>
2 #include <asm-generic/export.h>
7 .macro fixup op reg addr lbl
11 .section __ex_table,"a"
17 ENTRY(__asm_copy_to_user)
18 ENTRY(__asm_copy_from_user)
20 /* Enable access to user memory */
25 /* Use word-oriented copy only if low-order bits match */
31 andi t1, a3, ~(SZREG-1)
32 andi t0, t0, ~(SZREG-1)
34 * a3: terminal address of source region
35 * t0: lowest XLEN-aligned address in source
36 * t1: highest XLEN-aligned address in source
41 fixup REG_L, t2, (a1), 10f
42 fixup REG_S, t2, (a0), 10f
50 /* Disable access to user memory */
54 4: /* Edge case: unalignment */
55 fixup lbu, t2, (a1), 10f
56 fixup sb, t2, (a0), 10f
61 5: /* Edge case: remainder */
62 fixup lbu, t2, (a1), 10f
63 fixup sb, t2, (a0), 10f
68 ENDPROC(__asm_copy_to_user)
69 ENDPROC(__asm_copy_from_user)
70 EXPORT_SYMBOL(__asm_copy_to_user)
71 EXPORT_SYMBOL(__asm_copy_from_user)
76 /* Enable access to user memory */
82 andi t1, a3, ~(SZREG-1)
83 andi t0, t0, ~(SZREG-1)
85 * a3: terminal address of target region
86 * t0: lowest doubleword-aligned address in target region
87 * t1: highest doubleword-aligned address in target region
92 fixup REG_S, zero, (a0), 11f
99 /* Disable access to user memory */
103 4: /* Edge case: unalignment */
104 fixup sb, zero, (a0), 11f
108 5: /* Edge case: remainder */
109 fixup sb, zero, (a0), 11f
113 ENDPROC(__clear_user)
114 EXPORT_SYMBOL(__clear_user)
118 /* Fixup code for __copy_user(10) and __clear_user(11) */
120 /* Disable access to user memory */