.. | .. |
---|
7 | 7 | # define __ASM_FORM_RAW(x) x |
---|
8 | 8 | # define __ASM_FORM_COMMA(x) x, |
---|
9 | 9 | #else |
---|
10 | | -# define __ASM_FORM(x) " " #x " " |
---|
11 | | -# define __ASM_FORM_RAW(x) #x |
---|
12 | | -# define __ASM_FORM_COMMA(x) " " #x "," |
---|
| 10 | +#include <linux/stringify.h> |
---|
| 11 | + |
---|
| 12 | +# define __ASM_FORM(x) " " __stringify(x) " " |
---|
| 13 | +# define __ASM_FORM_RAW(x) __stringify(x) |
---|
| 14 | +# define __ASM_FORM_COMMA(x) " " __stringify(x) "," |
---|
13 | 15 | #endif |
---|
14 | 16 | |
---|
15 | 17 | #ifndef __x86_64__ |
---|
.. | .. |
---|
130 | 132 | # define _ASM_EXTABLE(from, to) \ |
---|
131 | 133 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) |
---|
132 | 134 | |
---|
| 135 | +# define _ASM_EXTABLE_UA(from, to) \ |
---|
| 136 | + _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess) |
---|
| 137 | + |
---|
| 138 | +# define _ASM_EXTABLE_CPY(from, to) \ |
---|
| 139 | + _ASM_EXTABLE_HANDLE(from, to, ex_handler_copy) |
---|
| 140 | + |
---|
133 | 141 | # define _ASM_EXTABLE_FAULT(from, to) \ |
---|
134 | 142 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) |
---|
135 | 143 | |
---|
136 | | -# define _ASM_EXTABLE_EX(from, to) \ |
---|
137 | | - _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext) |
---|
138 | | - |
---|
139 | | -# define _ASM_EXTABLE_REFCOUNT(from, to) \ |
---|
140 | | - _ASM_EXTABLE_HANDLE(from, to, ex_handler_refcount) |
---|
141 | | - |
---|
142 | | -# define _ASM_NOKPROBE(entry) \ |
---|
| 144 | +# ifdef CONFIG_KPROBES |
---|
| 145 | +# define _ASM_NOKPROBE(entry) \ |
---|
143 | 146 | .pushsection "_kprobe_blacklist","aw" ; \ |
---|
144 | 147 | _ASM_ALIGN ; \ |
---|
145 | 148 | _ASM_PTR (entry); \ |
---|
146 | 149 | .popsection |
---|
| 150 | +# else |
---|
| 151 | +# define _ASM_NOKPROBE(entry) |
---|
| 152 | +# endif |
---|
147 | 153 | |
---|
148 | | -.macro ALIGN_DESTINATION |
---|
149 | | - /* check for bad alignment of destination */ |
---|
150 | | - movl %edi,%ecx |
---|
151 | | - andl $7,%ecx |
---|
152 | | - jz 102f /* already aligned */ |
---|
153 | | - subl $8,%ecx |
---|
154 | | - negl %ecx |
---|
155 | | - subl %ecx,%edx |
---|
156 | | -100: movb (%rsi),%al |
---|
157 | | -101: movb %al,(%rdi) |
---|
158 | | - incq %rsi |
---|
159 | | - incq %rdi |
---|
160 | | - decl %ecx |
---|
161 | | - jnz 100b |
---|
162 | | -102: |
---|
163 | | - .section .fixup,"ax" |
---|
164 | | -103: addl %ecx,%edx /* ecx is zerorest also */ |
---|
165 | | - jmp copy_user_handle_tail |
---|
166 | | - .previous |
---|
167 | | - |
---|
168 | | - _ASM_EXTABLE(100b,103b) |
---|
169 | | - _ASM_EXTABLE(101b,103b) |
---|
170 | | - .endm |
---|
171 | | - |
---|
172 | | -#else |
---|
| 154 | +#else /* ! __ASSEMBLY__ */ |
---|
173 | 155 | # define _EXPAND_EXTABLE_HANDLE(x) #x |
---|
174 | 156 | # define _ASM_EXTABLE_HANDLE(from, to, handler) \ |
---|
175 | 157 | " .pushsection \"__ex_table\",\"a\"\n" \ |
---|
.. | .. |
---|
182 | 164 | # define _ASM_EXTABLE(from, to) \ |
---|
183 | 165 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) |
---|
184 | 166 | |
---|
| 167 | +# define _ASM_EXTABLE_UA(from, to) \ |
---|
| 168 | + _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess) |
---|
| 169 | + |
---|
| 170 | +# define _ASM_EXTABLE_CPY(from, to) \ |
---|
| 171 | + _ASM_EXTABLE_HANDLE(from, to, ex_handler_copy) |
---|
| 172 | + |
---|
185 | 173 | # define _ASM_EXTABLE_FAULT(from, to) \ |
---|
186 | 174 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) |
---|
187 | 175 | |
---|
188 | | -# define _ASM_EXTABLE_EX(from, to) \ |
---|
189 | | - _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext) |
---|
190 | | - |
---|
191 | | -# define _ASM_EXTABLE_REFCOUNT(from, to) \ |
---|
192 | | - _ASM_EXTABLE_HANDLE(from, to, ex_handler_refcount) |
---|
193 | | - |
---|
194 | 176 | /* For C file, we already have NOKPROBE_SYMBOL macro */ |
---|
195 | | -#endif |
---|
196 | 177 | |
---|
197 | | -#ifndef __ASSEMBLY__ |
---|
198 | 178 | /* |
---|
199 | 179 | * This output constraint should be used for any inline asm which has a "call" |
---|
200 | 180 | * instruction. Otherwise the asm may be inserted before the frame pointer |
---|
.. | .. |
---|
203 | 183 | */ |
---|
204 | 184 | register unsigned long current_stack_pointer asm(_ASM_SP); |
---|
205 | 185 | #define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer) |
---|
206 | | -#endif |
---|
| 186 | +#endif /* __ASSEMBLY__ */ |
---|
207 | 187 | |
---|
208 | 188 | #endif /* _ASM_X86_ASM_H */ |
---|