1 #include <linux/linkage.h>
6 .macro fixup op reg addr lbl
10 .section __ex_table,"a"
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
71 /* Enable access to user memory */
77 andi t1, a3, ~(SZREG-1)
78 andi t0, t0, ~(SZREG-1)
80 * a3: terminal address of target region
81 * t0: lowest doubleword-aligned address in target region
82 * t1: highest doubleword-aligned address in target region
87 fixup REG_S, zero, (a0), 10f
94 /* Disable access to user memory */
98 4: /* Edge case: unalignment */
99 fixup sb, zero, (a0), 10f
103 5: /* Edge case: remainder */
104 fixup sb, zero, (a0), 10f
108 ENDPROC(__clear_user)
113 /* Disable access to user memory */