1
2
3
4
5
6
7
8
9
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 .macro ldr1w ptr reg abort
34 ldrusr \reg, \ptr, 4, abort=\abort
35 .endm
36
37 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
38 100: ldm.w (\reg1, \reg2, \reg3, \reg4), [\ptr]+
39 .pushsection __ex_table, "a"
40 .align 3
41 .long 100b, \abort
42 .popsection
43 .endm
44
45 .macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
46 100: ldm.w (\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8), [\ptr]+
47 .pushsection __ex_table, "a"
48 .align 3
49 .long 100b, \abort
50 .popsection
51 .endm
52
53 .macro ldr1b ptr reg cond=al abort
54 ldrusr \reg, \ptr, 1, \cond, abort=\abort
55 .endm
56
57 .macro str1w ptr reg abort
58 stw.w \reg, [\ptr]+, #4
59 .endm
60
61 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
62 stm.w (\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8), [\ptr]+
63 .endm
64
65 .macro str1b ptr reg cond=al abort
66 .ifnc \cond, al
67 b\cond 201f
68 b 202f
69 .endif
70 201: stb.w \reg, [\ptr]+, #1
71 202:
72 .endm
73
74 .macro enter
75 mov r3, #0
76 stm.w (r0, r2, r3), [sp-]
77 .endm
78
79 .macro exit
80 add sp, sp, #8
81 ldm.w (r0), [sp]+
82 mov pc, lr
83 .endm
84
85 .text
86
87 ENTRY(raw_copy_from_user)
88
89 #include "copy_template.S"
90
91 ENDPROC(raw_copy_from_user)
92
93 .pushsection .fixup,"ax"
94 .align 0
95 copy_abort_preamble
96 ldm.w (r1, r2, r3), [sp]+
97 sub r0, r0, r1
98 rsub r0, r0, r2
99 copy_abort_end
100 .popsection
101