@@ -54,6 +54,7 @@ config IA64
select MODULES_USE_ELF_RELA
select ARCH_USE_CMPXCHG_LOCKREF
select HAVE_ARCH_AUDITSYSCALL
+ select HAVE_PRCTL_ARCH
default y
help
The Itanium Processor Family is Intel's 64-bit successor to
@@ -259,18 +259,6 @@ typedef struct {
(int __user *) (addr)); \
})
-#define SET_FPEMU_CTL(value) \
-({ \
- current->thread.flags = ((current->thread.flags & ~IA64_THREAD_FPEMU_MASK) \
- | (((value) << IA64_THREAD_FPEMU_SHIFT) & IA64_THREAD_FPEMU_MASK)); \
- 0; \
-})
-#define GET_FPEMU_CTL(addr) \
-({ \
- put_user((current->thread.flags & IA64_THREAD_FPEMU_MASK) >> IA64_THREAD_FPEMU_SHIFT, \
- (int __user *) (addr)); \
-})
-
struct thread_struct {
__u32 flags; /* various thread flags (see IA64_THREAD_*) */
/* writing on_ustack is performance-critical, so it's worth spending 8 bits on it... */
@@ -15,11 +15,13 @@
#include <linux/sched/task_stack.h>
#include <linux/shm.h>
#include <linux/file.h> /* doh, must come after sched.h... */
+#include <liunx/prctl.h>
#include <linux/smp.h>
#include <linux/syscalls.h>
#include <linux/highuid.h>
#include <linux/hugetlb.h>
+#include <asm/processor.h>
#include <asm/shmparam.h>
#include <linux/uaccess.h>
@@ -184,3 +186,23 @@ sys_pciconfig_write (unsigned long bus, unsigned long dfn, unsigned long off, un
}
#endif /* CONFIG_PCI */
+
+int prctl_arch(int option, unsigned long arg2, unsigned long arg3,
+ unsigned long arg4, unsigned long arg5)
+{
+ int res;
+
+ switch (option) {
+ case PR_SET_FPEMU:
+ current->thread.flags &= ~IA64_THREAD_FPEMU_MASK;
+ current->thread.flags |= (arg2 << IA64_THREAD_FPEMU_SHIFT) &
+ IA64_THREAD_FPEMU_MASK;
+ return 0;
+ case PR_GET_FPEMU:
+ res = (current->thread.flags & IA64_THREAD_FPEMU_MASK) >>
+ IA64_THREAD_FPEMU_SHIFT;
+ return put_user(res, (int __user *)arg2);
+ default:
+ return -EINVAL;
+ }
+}
@@ -77,12 +77,6 @@
#ifndef GET_UNALIGN_CTL
# define GET_UNALIGN_CTL(a, b) (-EINVAL)
#endif
-#ifndef SET_FPEMU_CTL
-# define SET_FPEMU_CTL(a) (-EINVAL)
-#endif
-#ifndef GET_FPEMU_CTL
-# define GET_FPEMU_CTL(a) (-EINVAL)
-#endif
/*
* this is where the system-wide overflow UID and GID are defined, for
@@ -2246,12 +2240,6 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
case PR_GET_UNALIGN:
error = GET_UNALIGN_CTL(me, arg2);
break;
- case PR_SET_FPEMU:
- error = SET_FPEMU_CTL(arg2);
- break;
- case PR_GET_FPEMU:
- error = GET_FPEMU_CTL(arg2);
- break;
case PR_GET_TIMING:
error = PR_TIMING_STATISTICAL;
break;
This patch moves the ia64-specific prctl call implementations out of core code and removes redundant boilerplate associated with them. No functional change. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> --- arch/ia64/Kconfig | 1 + arch/ia64/include/asm/processor.h | 12 ------------ arch/ia64/kernel/sys_ia64.c | 22 ++++++++++++++++++++++ kernel/sys.c | 12 ------------ 4 files changed, 23 insertions(+), 24 deletions(-) -- 2.1.4