aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKyle McMartin <kyle@parisc-linux.org>2005-10-21 22:43:15 -0400
committerKyle McMartin <kyle@parisc-linux.org>2005-10-21 22:43:15 -0400
commitf053725b8985d10c2cc4b837a80a381104c936a4 (patch)
treeb9539783ec2f608638dd0d92c2c56d49eb19d93e /arch
parent99ac79479928bae42d694b7cb53644be5d3b6dd2 (diff)
[PARISC] Add ability for prctl to change unaligned trap behaviour
Add support for changing unaligned trap behaviour on a per-thread basis. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/unaligned.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
index 62eea35bcd69..eaae8a021f9f 100644
--- a/arch/parisc/kernel/unaligned.c
+++ b/arch/parisc/kernel/unaligned.c
@@ -513,15 +513,18 @@ void handle_unaligned(struct pt_regs *regs)
513 register int flop=0; /* true if this is a flop */ 513 register int flop=0; /* true if this is a flop */
514 514
515 /* log a message with pacing */ 515 /* log a message with pacing */
516 if (user_mode(regs)) 516 if (user_mode(regs)) {
517 { 517 if (current->thread.flags & PARISC_UAC_SIGBUS) {
518 if (unaligned_count > 5 && jiffies - last_time > 5*HZ) 518 goto force_sigbus;
519 { 519 }
520
521 if (unaligned_count > 5 && jiffies - last_time > 5*HZ) {
520 unaligned_count = 0; 522 unaligned_count = 0;
521 last_time = jiffies; 523 last_time = jiffies;
522 } 524 }
523 if (++unaligned_count < 5) 525
524 { 526 if (!(current->thread.flags & PARISC_UAC_NOPRINT)
527 && ++unaligned_count < 5) {
525 char buf[256]; 528 char buf[256];
526 sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n", 529 sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n",
527 current->comm, current->pid, regs->ior, regs->iaoq[0]); 530 current->comm, current->pid, regs->ior, regs->iaoq[0]);
@@ -530,6 +533,7 @@ void handle_unaligned(struct pt_regs *regs)
530 show_regs(regs); 533 show_regs(regs);
531#endif 534#endif
532 } 535 }
536
533 if (!unaligned_enabled) 537 if (!unaligned_enabled)
534 goto force_sigbus; 538 goto force_sigbus;
535 } 539 }