summaryrefslogtreecommitdiffstats
path: root/include/asm-parisc
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 /include/asm-parisc
parent99ac79479928bae42d694b7cb53644be5d3b6dd2 (diff)
downloadlinux-f053725b8985d10c2cc4b837a80a381104c936a4.tar.gz
linux-f053725b8985d10c2cc4b837a80a381104c936a4.tar.bz2
linux-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 'include/asm-parisc')
-rw-r--r--include/asm-parisc/processor.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index a9dfadd05658..aae40e8c3aa8 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -122,8 +122,27 @@ struct thread_struct {
};
/* Thread struct flags. */
+#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */
+#define PARISC_UAC_SIGBUS (1UL << 1)
#define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */
+#define PARISC_UAC_SHIFT 0
+#define PARISC_UAC_MASK (PARISC_UAC_NOPRINT|PARISC_UAC_SIGBUS)
+
+#define SET_UNALIGN_CTL(task,value) \
+ ({ \
+ (task)->thread.flags = (((task)->thread.flags & ~PARISC_UAC_MASK) \
+ | (((value) << PARISC_UAC_SHIFT) & \
+ PARISC_UAC_MASK)); \
+ 0; \
+ })
+
+#define GET_UNALIGN_CTL(task,addr) \
+ ({ \
+ put_user(((task)->thread.flags & PARISC_UAC_MASK) \
+ >> PARISC_UAC_SHIFT, (int __user *) (addr)); \
+ })
+
#define INIT_THREAD { \
regs: { gr: { 0, }, \
fr: { 0, }, \