diff options
author | Kyle McMartin <kyle@parisc-linux.org> | 2005-10-21 22:43:15 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@parisc-linux.org> | 2005-10-21 22:43:15 -0400 |
commit | f053725b8985d10c2cc4b837a80a381104c936a4 (patch) | |
tree | b9539783ec2f608638dd0d92c2c56d49eb19d93e /arch/parisc | |
parent | 99ac79479928bae42d694b7cb53644be5d3b6dd2 (diff) | |
download | kernel_samsung_smdk4412-f053725b8985d10c2cc4b837a80a381104c936a4.tar.gz kernel_samsung_smdk4412-f053725b8985d10c2cc4b837a80a381104c936a4.tar.bz2 kernel_samsung_smdk4412-f053725b8985d10c2cc4b837a80a381104c936a4.zip |
[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/parisc')
-rw-r--r-- | arch/parisc/kernel/unaligned.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index 62eea35bcd6..eaae8a021f9 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -513,15 +513,18 @@ void handle_unaligned(struct pt_regs *regs) register int flop=0; /* true if this is a flop */ /* log a message with pacing */ - if (user_mode(regs)) - { - if (unaligned_count > 5 && jiffies - last_time > 5*HZ) - { + if (user_mode(regs)) { + if (current->thread.flags & PARISC_UAC_SIGBUS) { + goto force_sigbus; + } + + if (unaligned_count > 5 && jiffies - last_time > 5*HZ) { unaligned_count = 0; last_time = jiffies; } - if (++unaligned_count < 5) - { + + if (!(current->thread.flags & PARISC_UAC_NOPRINT) + && ++unaligned_count < 5) { char buf[256]; sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n", current->comm, current->pid, regs->ior, regs->iaoq[0]); @@ -530,6 +533,7 @@ void handle_unaligned(struct pt_regs *regs) show_regs(regs); #endif } + if (!unaligned_enabled) goto force_sigbus; } |