Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1598439
| From | Kyle Huey <me@kylehuey.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v15 1/9] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl |
| Date | 2017-03-11 20:50 +0100 |
| Message-ID | <tjVbA-7mC-7@gated-at.bofh.it> (permalink) |
| References | <tjVbA-7mC-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Use the SYSCALL_DEFINE2 macro instead of manually defining it.
Signed-off-by: Kyle Huey <khuey@kylehuey.com>
---
arch/x86/kernel/process_64.c | 3 ++-
arch/x86/um/syscalls_64.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index d6b784a5520d..9a72612b25ee 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -32,16 +32,17 @@
#include <linux/ptrace.h>
#include <linux/notifier.h>
#include <linux/kprobes.h>
#include <linux/kdebug.h>
#include <linux/prctl.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/ftrace.h>
+#include <linux/syscalls.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/fpu/internal.h>
#include <asm/mmu_context.h>
#include <asm/prctl.h>
#include <asm/desc.h>
#include <asm/proto.h>
@@ -616,17 +617,17 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
default:
ret = -EINVAL;
break;
}
return ret;
}
-long sys_arch_prctl(int code, unsigned long addr)
+SYSCALL_DEFINE2(arch_prctl, int, code, unsigned long, addr)
{
return do_arch_prctl(current, code, addr);
}
unsigned long KSTK_ESP(struct task_struct *task)
{
return task_pt_regs(task)->sp;
}
diff --git a/arch/x86/um/syscalls_64.c b/arch/x86/um/syscalls_64.c
index 10d907098c26..2041acd77e73 100644
--- a/arch/x86/um/syscalls_64.c
+++ b/arch/x86/um/syscalls_64.c
@@ -2,16 +2,17 @@
* Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Copyright 2003 PathScale, Inc.
*
* Licensed under the GPL
*/
#include <linux/sched.h>
#include <linux/sched/mm.h>
+#include <linux/syscalls.h>
#include <linux/uaccess.h>
#include <asm/prctl.h> /* XXX This should get the constants from libc */
#include <os.h>
long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr)
{
unsigned long *ptr = addr, tmp;
long ret;
@@ -68,17 +69,17 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr)
case ARCH_GET_GS:
ret = put_user(tmp, addr);
break;
}
return ret;
}
-long sys_arch_prctl(int code, unsigned long addr)
+SYSCALL_DEFINE2(arch_prctl, int, code, unsigned long, addr)
{
return arch_prctl(current, code, (unsigned long __user *) addr);
}
void arch_switch_to(struct task_struct *to)
{
if ((to->thread.arch.fs == 0) || (to->mm == NULL))
return;
--
2.11.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v15 0/9] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 1/9] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 8/9] KVM: x86: virtualize cpuid faulting Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 3/9] x86/arch_prctl: Add do_arch_prctl_common Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 4/9] x86/syscalls/32: Wire up arch_prctl on x86-32 Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 5/9] x86/cpufeature: Detect CPUID faulting support Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 7/9] x86/arch_prctl: Selftest for ARCH_[GET|SET]_CPUID Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 2/9] x86/arch_prctl/64: Rename do_arch_prctl to do_arch_prctl_64 Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100 [PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option' Kyle Huey <me@kylehuey.com> - 2017-03-11 20:50 +0100
csiph-web