summaryrefslogtreecommitdiff
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2002-08-13 06:27:23 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-08-13 06:27:23 -0700
commitfcc6fcc61d5d2e32f689bbfcacd031e4c3d40268 (patch)
tree67e671cdf4df365b5e31e1ba02b601088c8b9095 /kernel/sys.c
parente1b19d6e06a98874018c66990465dcc69b69c4bf (diff)
[PATCH] add FP exception mode prctl
This patch that adds a prctl so that processes can set their floating-point exception mode on PPC and on PPC64. We need this because the FP exception mode is controlled by bits in the machine state register, which can only be accessed by the kernel, and because the exception mode setting interacts with the lazy FPU save/restore that the kernel does.
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 316a63de74ea..8a6d5da46335 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -37,6 +37,12 @@
#ifndef GET_FPEMU_CTL
# define GET_FPEMU_CTL(a,b) (-EINVAL)
#endif
+#ifndef SET_FPEXC_CTL
+# define SET_FPEXC_CTL(a,b) (-EINVAL)
+#endif
+#ifndef GET_FPEXC_CTL
+# define GET_FPEXC_CTL(a,b) (-EINVAL)
+#endif
/*
* this is where the system-wide overflow UID and GID are defined, for
@@ -1283,6 +1289,13 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
case PR_GET_FPEMU:
error = GET_FPEMU_CTL(current, arg2);
break;
+ case PR_SET_FPEXC:
+ error = SET_FPEXC_CTL(current, arg2);
+ break;
+ case PR_GET_FPEXC:
+ error = GET_FPEXC_CTL(current, arg2);
+ break;
+
case PR_GET_KEEPCAPS:
if (current->keep_capabilities)