aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/frv/kernel/traps.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index 7089c2428b3f..a40df80b2ebd 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -49,7 +49,7 @@ asmlinkage void insn_access_error(unsigned long esfr1, unsigned long epcr0, unsi
49 info.si_signo = SIGSEGV; 49 info.si_signo = SIGSEGV;
50 info.si_code = SEGV_ACCERR; 50 info.si_code = SEGV_ACCERR;
51 info.si_errno = 0; 51 info.si_errno = 0;
52 info.si_addr = (void *) ((epcr0 & EPCR0_V) ? (epcr0 & EPCR0_PC) : __frame->pc); 52 info.si_addr = (void __user *) ((epcr0 & EPCR0_V) ? (epcr0 & EPCR0_PC) : __frame->pc);
53 53
54 force_sig_info(info.si_signo, &info, current); 54 force_sig_info(info.si_signo, &info, current);
55} /* end insn_access_error() */ 55} /* end insn_access_error() */
@@ -73,7 +73,7 @@ asmlinkage void illegal_instruction(unsigned long esfr1, unsigned long epcr0, un
73 epcr0, esr0, esfr1); 73 epcr0, esr0, esfr1);
74 74
75 info.si_errno = 0; 75 info.si_errno = 0;
76 info.si_addr = (void *) ((epcr0 & EPCR0_V) ? (epcr0 & EPCR0_PC) : __frame->pc); 76 info.si_addr = (void __user *) ((epcr0 & EPCR0_V) ? (epcr0 & EPCR0_PC) : __frame->pc);
77 77
78 switch (__frame->tbr & TBR_TT) { 78 switch (__frame->tbr & TBR_TT) {
79 case TBR_TT_ILLEGAL_INSTR: 79 case TBR_TT_ILLEGAL_INSTR:
@@ -111,7 +111,8 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
111 unsigned long esr0) 111 unsigned long esr0)
112{ 112{
113 static DEFINE_SPINLOCK(atomic_op_lock); 113 static DEFINE_SPINLOCK(atomic_op_lock);
114 unsigned long x, y, z, *p; 114 unsigned long x, y, z;
115 unsigned long __user *p;
115 mm_segment_t oldfs; 116 mm_segment_t oldfs;
116 siginfo_t info; 117 siginfo_t info;
117 int ret; 118 int ret;
@@ -128,7 +129,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
128 * u32 __atomic_user_cmpxchg32(u32 *ptr, u32 test, u32 new) 129 * u32 __atomic_user_cmpxchg32(u32 *ptr, u32 test, u32 new)
129 */ 130 */
130 case TBR_TT_ATOMIC_CMPXCHG32: 131 case TBR_TT_ATOMIC_CMPXCHG32:
131 p = (unsigned long *) __frame->gr8; 132 p = (unsigned long __user *) __frame->gr8;
132 x = __frame->gr9; 133 x = __frame->gr9;
133 y = __frame->gr10; 134 y = __frame->gr10;
134 135
@@ -158,7 +159,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
158 * u32 __atomic_kernel_xchg32(void *v, u32 new) 159 * u32 __atomic_kernel_xchg32(void *v, u32 new)
159 */ 160 */
160 case TBR_TT_ATOMIC_XCHG32: 161 case TBR_TT_ATOMIC_XCHG32:
161 p = (unsigned long *) __frame->gr8; 162 p = (unsigned long __user *) __frame->gr8;
162 y = __frame->gr9; 163 y = __frame->gr9;
163 164
164 for (;;) { 165 for (;;) {
@@ -181,7 +182,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
181 * ulong __atomic_kernel_XOR_return(ulong i, ulong *v) 182 * ulong __atomic_kernel_XOR_return(ulong i, ulong *v)
182 */ 183 */
183 case TBR_TT_ATOMIC_XOR: 184 case TBR_TT_ATOMIC_XOR:
184 p = (unsigned long *) __frame->gr8; 185 p = (unsigned long __user *) __frame->gr8;
185 x = __frame->gr9; 186 x = __frame->gr9;
186 187
187 for (;;) { 188 for (;;) {
@@ -205,7 +206,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
205 * ulong __atomic_kernel_OR_return(ulong i, ulong *v) 206 * ulong __atomic_kernel_OR_return(ulong i, ulong *v)
206 */ 207 */
207 case TBR_TT_ATOMIC_OR: 208 case TBR_TT_ATOMIC_OR:
208 p = (unsigned long *) __frame->gr8; 209 p = (unsigned long __user *) __frame->gr8;
209 x = __frame->gr9; 210 x = __frame->gr9;
210 211
211 for (;;) { 212 for (;;) {
@@ -229,7 +230,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
229 * ulong __atomic_kernel_AND_return(ulong i, ulong *v) 230 * ulong __atomic_kernel_AND_return(ulong i, ulong *v)
230 */ 231 */
231 case TBR_TT_ATOMIC_AND: 232 case TBR_TT_ATOMIC_AND:
232 p = (unsigned long *) __frame->gr8; 233 p = (unsigned long __user *) __frame->gr8;
233 x = __frame->gr9; 234 x = __frame->gr9;
234 235
235 for (;;) { 236 for (;;) {
@@ -253,7 +254,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
253 * int __atomic_user_sub_return(atomic_t *v, int i) 254 * int __atomic_user_sub_return(atomic_t *v, int i)
254 */ 255 */
255 case TBR_TT_ATOMIC_SUB: 256 case TBR_TT_ATOMIC_SUB:
256 p = (unsigned long *) __frame->gr8; 257 p = (unsigned long __user *) __frame->gr8;
257 x = __frame->gr9; 258 x = __frame->gr9;
258 259
259 for (;;) { 260 for (;;) {
@@ -277,7 +278,7 @@ asmlinkage void atomic_operation(unsigned long esfr1, unsigned long epcr0,
277 * int __atomic_user_add_return(atomic_t *v, int i) 278 * int __atomic_user_add_return(atomic_t *v, int i)
278 */ 279 */
279 case TBR_TT_ATOMIC_ADD: 280 case TBR_TT_ATOMIC_ADD:
280 p = (unsigned long *) __frame->gr8; 281 p = (unsigned long __user *) __frame->gr8;
281 x = __frame->gr9; 282 x = __frame->gr9;
282 283
283 for (;;) { 284 for (;;) {
@@ -322,7 +323,7 @@ error:
322 info.si_signo = SIGSEGV; 323 info.si_signo = SIGSEGV;
323 info.si_code = SEGV_ACCERR; 324 info.si_code = SEGV_ACCERR;
324 info.si_errno = 0; 325 info.si_errno = 0;
325 info.si_addr = (void *) __frame->pc; 326 info.si_addr = (void __user *) __frame->pc;
326 327
327 force_sig_info(info.si_signo, &info, current); 328 force_sig_info(info.si_signo, &info, current);
328} 329}
@@ -343,7 +344,7 @@ asmlinkage void media_exception(unsigned long msr0, unsigned long msr1)
343 info.si_signo = SIGFPE; 344 info.si_signo = SIGFPE;
344 info.si_code = FPE_MDAOVF; 345 info.si_code = FPE_MDAOVF;
345 info.si_errno = 0; 346 info.si_errno = 0;
346 info.si_addr = (void *) __frame->pc; 347 info.si_addr = (void __user *) __frame->pc;
347 348
348 force_sig_info(info.si_signo, &info, current); 349 force_sig_info(info.si_signo, &info, current);
349} /* end media_exception() */ 350} /* end media_exception() */
@@ -383,7 +384,7 @@ asmlinkage void memory_access_exception(unsigned long esr0,
383 info.si_addr = NULL; 384 info.si_addr = NULL;
384 385
385 if ((esr0 & (ESRx_VALID | ESR0_EAV)) == (ESRx_VALID | ESR0_EAV)) 386 if ((esr0 & (ESRx_VALID | ESR0_EAV)) == (ESRx_VALID | ESR0_EAV))
386 info.si_addr = (void *) ear0; 387 info.si_addr = (void __user *) ear0;
387 388
388 force_sig_info(info.si_signo, &info, current); 389 force_sig_info(info.si_signo, &info, current);
389 390
@@ -412,7 +413,7 @@ asmlinkage void data_access_error(unsigned long esfr1, unsigned long esr15, unsi
412 info.si_signo = SIGSEGV; 413 info.si_signo = SIGSEGV;
413 info.si_code = SEGV_ACCERR; 414 info.si_code = SEGV_ACCERR;
414 info.si_errno = 0; 415 info.si_errno = 0;
415 info.si_addr = (void *) 416 info.si_addr = (void __user *)
416 (((esr15 & (ESRx_VALID|ESR15_EAV)) == (ESRx_VALID|ESR15_EAV)) ? ear15 : 0); 417 (((esr15 & (ESRx_VALID|ESR15_EAV)) == (ESRx_VALID|ESR15_EAV)) ? ear15 : 0);
417 418
418 force_sig_info(info.si_signo, &info, current); 419 force_sig_info(info.si_signo, &info, current);
@@ -446,7 +447,7 @@ asmlinkage void division_exception(unsigned long esfr1, unsigned long esr0, unsi
446 info.si_signo = SIGFPE; 447 info.si_signo = SIGFPE;
447 info.si_code = FPE_INTDIV; 448 info.si_code = FPE_INTDIV;
448 info.si_errno = 0; 449 info.si_errno = 0;
449 info.si_addr = (void *) __frame->pc; 450 info.si_addr = (void __user *) __frame->pc;
450 451
451 force_sig_info(info.si_signo, &info, current); 452 force_sig_info(info.si_signo, &info, current);
452} /* end division_exception() */ 453} /* end division_exception() */