summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorPaul Mackerras2006-06-07 08:15:39 +0200
committerPaul Mackerras2006-06-09 13:24:16 +0200
commite9370ae15dc2f8ba1e1889ce26f13cda565b6ecb (patch)
tree338ed732f7a6607bc168795008e244f180876cda /arch/powerpc/kernel/process.c
parent[PATCH] powerpc: Implement support for setting little-endian mode via prctl (diff)
downloadkernel-qcow2-linux-e9370ae15dc2f8ba1e1889ce26f13cda565b6ecb.tar.gz
kernel-qcow2-linux-e9370ae15dc2f8ba1e1889ce26f13cda565b6ecb.tar.xz
kernel-qcow2-linux-e9370ae15dc2f8ba1e1889ce26f13cda565b6ecb.zip
[PATCH] powerpc: Implement PR_[GS]ET_UNALIGN prctls for powerpc
This gives the ability to control whether alignment exceptions get fixed up or reported to the process as a SIGBUS, using the existing PR_SET_UNALIGN and PR_GET_UNALIGN prctls. We do not implement the option of logging a message on alignment exceptions. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 2d35d83961b2..e4732459c485 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -752,6 +752,17 @@ int get_endian(struct task_struct *tsk, unsigned long adr)
return put_user(val, (unsigned int __user *)adr);
}
+int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
+{
+ tsk->thread.align_ctl = val;
+ return 0;
+}
+
+int get_unalign_ctl(struct task_struct *tsk, unsigned long adr)
+{
+ return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr);
+}
+
#define TRUNC_PTR(x) ((typeof(x))(((unsigned long)(x)) & 0xffffffff))
int sys_clone(unsigned long clone_flags, unsigned long usp,