diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2013-12-17 08:15:40 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-26 18:09:15 -0400 |
commit | d84869a19faa0fd541a9d3cc93cfe8ac3f0c4d83 (patch) | |
tree | da9ee1c53629c94c75b3f1f1729bec6f7aeef91c | |
parent | fd9720e96e856160f94907db06b707841cbafb0d (diff) |
MIPS: asm: uaccess: Add instruction argument to __{put,get}_user_asm
In preparation for EVA support, an instruction argument is needed
for the __get_user_asm{,_ll32} functions to allow instruction overrides in
EVA mode. Even though EVA only works for MIPS 32-bit, both codepaths are
changed (32-bit and 64-bit) for consistency reasons.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
-rw-r--r-- | arch/mips/include/asm/uaccess.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index f3fa3750f577..5ba393392ce3 100644 --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h | |||
@@ -223,10 +223,10 @@ struct __large_struct { unsigned long buf[100]; }; | |||
223 | * for 32 bit mode and old iron. | 223 | * for 32 bit mode and old iron. |
224 | */ | 224 | */ |
225 | #ifdef CONFIG_32BIT | 225 | #ifdef CONFIG_32BIT |
226 | #define __GET_USER_DW(val, ptr) __get_user_asm_ll32(val, ptr) | 226 | #define __GET_USER_DW(val, insn, ptr) __get_user_asm_ll32(val, insn, ptr) |
227 | #endif | 227 | #endif |
228 | #ifdef CONFIG_64BIT | 228 | #ifdef CONFIG_64BIT |
229 | #define __GET_USER_DW(val, ptr) __get_user_asm(val, "ld", ptr) | 229 | #define __GET_USER_DW(val, insn, ptr) __get_user_asm(val, "ld", ptr) |
230 | #endif | 230 | #endif |
231 | 231 | ||
232 | extern void __get_user_unknown(void); | 232 | extern void __get_user_unknown(void); |
@@ -237,7 +237,7 @@ do { \ | |||
237 | case 1: __get_user_asm(val, "lb", ptr); break; \ | 237 | case 1: __get_user_asm(val, "lb", ptr); break; \ |
238 | case 2: __get_user_asm(val, "lh", ptr); break; \ | 238 | case 2: __get_user_asm(val, "lh", ptr); break; \ |
239 | case 4: __get_user_asm(val, "lw", ptr); break; \ | 239 | case 4: __get_user_asm(val, "lw", ptr); break; \ |
240 | case 8: __GET_USER_DW(val, ptr); break; \ | 240 | case 8: __GET_USER_DW(val, "lw", ptr); break; \ |
241 | default: __get_user_unknown(); break; \ | 241 | default: __get_user_unknown(); break; \ |
242 | } \ | 242 | } \ |
243 | } while (0) | 243 | } while (0) |
@@ -287,7 +287,7 @@ do { \ | |||
287 | /* | 287 | /* |
288 | * Get a long long 64 using 32 bit registers. | 288 | * Get a long long 64 using 32 bit registers. |
289 | */ | 289 | */ |
290 | #define __get_user_asm_ll32(val, addr) \ | 290 | #define __get_user_asm_ll32(val, insn, addr) \ |
291 | { \ | 291 | { \ |
292 | union { \ | 292 | union { \ |
293 | unsigned long long l; \ | 293 | unsigned long long l; \ |
@@ -295,8 +295,8 @@ do { \ | |||
295 | } __gu_tmp; \ | 295 | } __gu_tmp; \ |
296 | \ | 296 | \ |
297 | __asm__ __volatile__( \ | 297 | __asm__ __volatile__( \ |
298 | "1: lw %1, (%3) \n" \ | 298 | "1: " insn " %1, (%3) \n" \ |
299 | "2: lw %D1, 4(%3) \n" \ | 299 | "2: " insn " %D1, 4(%3) \n" \ |
300 | "3: \n" \ | 300 | "3: \n" \ |
301 | " .insn \n" \ | 301 | " .insn \n" \ |
302 | " .section .fixup,\"ax\" \n" \ | 302 | " .section .fixup,\"ax\" \n" \ |
@@ -320,10 +320,10 @@ do { \ | |||
320 | * for 32 bit mode and old iron. | 320 | * for 32 bit mode and old iron. |
321 | */ | 321 | */ |
322 | #ifdef CONFIG_32BIT | 322 | #ifdef CONFIG_32BIT |
323 | #define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr) | 323 | #define __PUT_USER_DW(insn, ptr) __put_user_asm_ll32(insn, ptr) |
324 | #endif | 324 | #endif |
325 | #ifdef CONFIG_64BIT | 325 | #ifdef CONFIG_64BIT |
326 | #define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr) | 326 | #define __PUT_USER_DW(insn, ptr) __put_user_asm("sd", ptr) |
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | #define __put_user_nocheck(x, ptr, size) \ | 329 | #define __put_user_nocheck(x, ptr, size) \ |
@@ -337,7 +337,7 @@ do { \ | |||
337 | case 1: __put_user_asm("sb", ptr); break; \ | 337 | case 1: __put_user_asm("sb", ptr); break; \ |
338 | case 2: __put_user_asm("sh", ptr); break; \ | 338 | case 2: __put_user_asm("sh", ptr); break; \ |
339 | case 4: __put_user_asm("sw", ptr); break; \ | 339 | case 4: __put_user_asm("sw", ptr); break; \ |
340 | case 8: __PUT_USER_DW(ptr); break; \ | 340 | case 8: __PUT_USER_DW("sw", ptr); break; \ |
341 | default: __put_user_unknown(); break; \ | 341 | default: __put_user_unknown(); break; \ |
342 | } \ | 342 | } \ |
343 | __pu_err; \ | 343 | __pu_err; \ |
@@ -355,7 +355,7 @@ do { \ | |||
355 | case 1: __put_user_asm("sb", __pu_addr); break; \ | 355 | case 1: __put_user_asm("sb", __pu_addr); break; \ |
356 | case 2: __put_user_asm("sh", __pu_addr); break; \ | 356 | case 2: __put_user_asm("sh", __pu_addr); break; \ |
357 | case 4: __put_user_asm("sw", __pu_addr); break; \ | 357 | case 4: __put_user_asm("sw", __pu_addr); break; \ |
358 | case 8: __PUT_USER_DW(__pu_addr); break; \ | 358 | case 8: __PUT_USER_DW("sw", __pu_addr); break; \ |
359 | default: __put_user_unknown(); break; \ | 359 | default: __put_user_unknown(); break; \ |
360 | } \ | 360 | } \ |
361 | } \ | 361 | } \ |
@@ -380,11 +380,11 @@ do { \ | |||
380 | "i" (-EFAULT)); \ | 380 | "i" (-EFAULT)); \ |
381 | } | 381 | } |
382 | 382 | ||
383 | #define __put_user_asm_ll32(ptr) \ | 383 | #define __put_user_asm_ll32(insn, ptr) \ |
384 | { \ | 384 | { \ |
385 | __asm__ __volatile__( \ | 385 | __asm__ __volatile__( \ |
386 | "1: sw %2, (%3) # __put_user_asm_ll32 \n" \ | 386 | "1: " insn " %2, (%3)# __put_user_asm_ll32 \n" \ |
387 | "2: sw %D2, 4(%3) \n" \ | 387 | "2: " insn " %D2, 4(%3) \n" \ |
388 | "3: \n" \ | 388 | "3: \n" \ |
389 | " .insn \n" \ | 389 | " .insn \n" \ |
390 | " .section .fixup,\"ax\" \n" \ | 390 | " .section .fixup,\"ax\" \n" \ |