aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/io_trapped.c3
-rw-r--r--arch/sh/kernel/traps_32.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index e27a19e1f46e..69be603aa2d7 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -284,7 +284,8 @@ int handle_trapped_io(struct pt_regs *regs, unsigned long address)
284 return 0; 284 return 0;
285 } 285 }
286 286
287 tmp = handle_unaligned_access(instruction, regs, &trapped_io_access); 287 tmp = handle_unaligned_access(instruction, regs,
288 &trapped_io_access, 1);
288 set_fs(oldfs); 289 set_fs(oldfs);
289 return tmp == 0; 290 return tmp == 0;
290} 291}
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index c581dc31d92a..583ace55b0dc 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -449,7 +449,7 @@ static inline int handle_delayslot(struct pt_regs *regs,
449#define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4) 449#define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4)
450 450
451int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, 451int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
452 struct mem_access *ma) 452 struct mem_access *ma, int expected)
453{ 453{
454 u_int rm; 454 u_int rm;
455 int ret, index; 455 int ret, index;
@@ -458,7 +458,7 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
458 rm = regs->regs[index]; 458 rm = regs->regs[index];
459 459
460 /* shout about fixups */ 460 /* shout about fixups */
461 if (printk_ratelimit()) 461 if (!expected && printk_ratelimit())
462 printk(KERN_NOTICE "Fixing up unaligned %s access " 462 printk(KERN_NOTICE "Fixing up unaligned %s access "
463 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", 463 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
464 user_mode(regs) ? "userspace" : "kernel", 464 user_mode(regs) ? "userspace" : "kernel",
@@ -657,7 +657,7 @@ fixup:
657 657
658 set_fs(USER_DS); 658 set_fs(USER_DS);
659 tmp = handle_unaligned_access(instruction, regs, 659 tmp = handle_unaligned_access(instruction, regs,
660 &user_mem_access); 660 &user_mem_access, 0);
661 set_fs(oldfs); 661 set_fs(oldfs);
662 662
663 if (tmp==0) 663 if (tmp==0)
@@ -694,7 +694,8 @@ uspace_segv:
694 die("insn faulting in do_address_error", regs, 0); 694 die("insn faulting in do_address_error", regs, 0);
695 } 695 }
696 696
697 handle_unaligned_access(instruction, regs, &user_mem_access); 697 handle_unaligned_access(instruction, regs,
698 &user_mem_access, 0);
698 set_fs(oldfs); 699 set_fs(oldfs);
699 } 700 }
700} 701}