diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/sigcontext.h | 33 | ||||
-rw-r--r-- | include/asm-mips/uaccess.h | 51 |
2 files changed, 65 insertions, 19 deletions
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index 3c175a7e4345..972947474eb7 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h | |||
@@ -42,6 +42,7 @@ struct sigcontext { | |||
42 | 42 | ||
43 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 | 43 | #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 |
44 | 44 | ||
45 | #include <linux/posix_types.h> | ||
45 | /* | 46 | /* |
46 | * Keep this struct definition in sync with the sigcontext fragment | 47 | * Keep this struct definition in sync with the sigcontext fragment |
47 | * in arch/mips/tools/offset.c | 48 | * in arch/mips/tools/offset.c |
@@ -53,27 +54,25 @@ struct sigcontext { | |||
53 | * entries, add sc_dsp and sc_reserved for padding. No prisoners. | 54 | * entries, add sc_dsp and sc_reserved for padding. No prisoners. |
54 | */ | 55 | */ |
55 | struct sigcontext { | 56 | struct sigcontext { |
56 | unsigned long sc_regs[32]; | 57 | __u64 sc_regs[32]; |
57 | unsigned long sc_fpregs[32]; | 58 | __u64 sc_fpregs[32]; |
58 | unsigned long sc_mdhi; | 59 | __u64 sc_mdhi; |
59 | unsigned long sc_hi1; | 60 | __u64 sc_hi1; |
60 | unsigned long sc_hi2; | 61 | __u64 sc_hi2; |
61 | unsigned long sc_hi3; | 62 | __u64 sc_hi3; |
62 | unsigned long sc_mdlo; | 63 | __u64 sc_mdlo; |
63 | unsigned long sc_lo1; | 64 | __u64 sc_lo1; |
64 | unsigned long sc_lo2; | 65 | __u64 sc_lo2; |
65 | unsigned long sc_lo3; | 66 | __u64 sc_lo3; |
66 | unsigned long sc_pc; | 67 | __u64 sc_pc; |
67 | unsigned int sc_fpc_csr; | 68 | __u32 sc_fpc_csr; |
68 | unsigned int sc_used_math; | 69 | __u32 sc_used_math; |
69 | unsigned int sc_dsp; | 70 | __u32 sc_dsp; |
70 | unsigned int sc_reserved; | 71 | __u32 sc_reserved; |
71 | }; | 72 | }; |
72 | 73 | ||
73 | #ifdef __KERNEL__ | 74 | #ifdef __KERNEL__ |
74 | 75 | ||
75 | #include <linux/posix_types.h> | ||
76 | |||
77 | struct sigcontext32 { | 76 | struct sigcontext32 { |
78 | __u32 sc_regmask; /* Unused */ | 77 | __u32 sc_regmask; /* Unused */ |
79 | __u32 sc_status; /* Unused */ | 78 | __u32 sc_status; /* Unused */ |
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 3eff8d8fe28a..c62c20e7b5c6 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h | |||
@@ -435,8 +435,32 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
435 | __cu_len; \ | 435 | __cu_len; \ |
436 | }) | 436 | }) |
437 | 437 | ||
438 | #define __copy_to_user_inatomic __copy_to_user | 438 | #define __copy_to_user_inatomic(to,from,n) \ |
439 | #define __copy_from_user_inatomic __copy_from_user | 439 | ({ \ |
440 | void __user *__cu_to; \ | ||
441 | const void *__cu_from; \ | ||
442 | long __cu_len; \ | ||
443 | \ | ||
444 | __cu_to = (to); \ | ||
445 | __cu_from = (from); \ | ||
446 | __cu_len = (n); \ | ||
447 | __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \ | ||
448 | __cu_len; \ | ||
449 | }) | ||
450 | |||
451 | #define __copy_from_user_inatomic(to,from,n) \ | ||
452 | ({ \ | ||
453 | void *__cu_to; \ | ||
454 | const void __user *__cu_from; \ | ||
455 | long __cu_len; \ | ||
456 | \ | ||
457 | __cu_to = (to); \ | ||
458 | __cu_from = (from); \ | ||
459 | __cu_len = (n); \ | ||
460 | __cu_len = __invoke_copy_from_user_inatomic(__cu_to, __cu_from, \ | ||
461 | __cu_len); \ | ||
462 | __cu_len; \ | ||
463 | }) | ||
440 | 464 | ||
441 | /* | 465 | /* |
442 | * copy_to_user: - Copy a block of data into user space. | 466 | * copy_to_user: - Copy a block of data into user space. |
@@ -490,6 +514,29 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
490 | __cu_len_r; \ | 514 | __cu_len_r; \ |
491 | }) | 515 | }) |
492 | 516 | ||
517 | #define __invoke_copy_from_user_inatomic(to,from,n) \ | ||
518 | ({ \ | ||
519 | register void *__cu_to_r __asm__ ("$4"); \ | ||
520 | register const void __user *__cu_from_r __asm__ ("$5"); \ | ||
521 | register long __cu_len_r __asm__ ("$6"); \ | ||
522 | \ | ||
523 | __cu_to_r = (to); \ | ||
524 | __cu_from_r = (from); \ | ||
525 | __cu_len_r = (n); \ | ||
526 | __asm__ __volatile__( \ | ||
527 | ".set\tnoreorder\n\t" \ | ||
528 | __MODULE_JAL(__copy_user_inatomic) \ | ||
529 | ".set\tnoat\n\t" \ | ||
530 | __UA_ADDU "\t$1, %1, %2\n\t" \ | ||
531 | ".set\tat\n\t" \ | ||
532 | ".set\treorder" \ | ||
533 | : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \ | ||
534 | : \ | ||
535 | : "$8", "$9", "$10", "$11", "$12", "$15", "$24", "$31", \ | ||
536 | "memory"); \ | ||
537 | __cu_len_r; \ | ||
538 | }) | ||
539 | |||
493 | /* | 540 | /* |
494 | * __copy_from_user: - Copy a block of data from user space, with less checking. | 541 | * __copy_from_user: - Copy a block of data from user space, with less checking. |
495 | * @to: Destination address, in kernel space. | 542 | * @to: Destination address, in kernel space. |