diff options
author | Kyle Huey <me@kylehuey.com> | 2017-03-20 04:16:20 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-03-20 11:10:32 -0400 |
commit | dd93938a92dc067aba70c401bdf2e50ed58083db (patch) | |
tree | e0d5d1f6552b47489e62414192421ab074f6e404 | |
parent | ab6d9468631a6e56e4c071c6ce6710956485fe08 (diff) |
x86/arch_prctl: Rename 'code' argument to 'option'
The x86 specific arch_prctl() arbitrarily changed prctl's 'option' to
'code'. Before adding new options, rename it.
Signed-off-by: Kyle Huey <khuey@kylehuey.com>
Cc: Grzegorz Andrejczuk <grzegorz.andrejczuk@intel.com>
Cc: kvm@vger.kernel.org
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: linux-kselftest@vger.kernel.org
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Robert O'Callahan <robert@ocallahan.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: user-mode-linux-user@lists.sourceforge.net
Cc: David Matlack <dmatlack@google.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: linux-fsdevel@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Link: http://lkml.kernel.org/r/20170320081628.18952-3-khuey@kylehuey.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/um/include/shared/os.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/proto.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/process_64.c | 8 | ||||
-rw-r--r-- | arch/x86/um/asm/ptrace.h | 2 | ||||
-rw-r--r-- | arch/x86/um/os-Linux/prctl.c | 4 | ||||
-rw-r--r-- | arch/x86/um/syscalls_64.c | 13 |
6 files changed, 17 insertions, 16 deletions
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index de5d572225f3..32e41c4ef6d3 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h | |||
@@ -302,8 +302,8 @@ extern int ignore_sigio_fd(int fd); | |||
302 | extern void maybe_sigio_broken(int fd, int read); | 302 | extern void maybe_sigio_broken(int fd, int read); |
303 | extern void sigio_broken(int fd, int read); | 303 | extern void sigio_broken(int fd, int read); |
304 | 304 | ||
305 | /* sys-x86_64/prctl.c */ | 305 | /* prctl.c */ |
306 | extern int os_arch_prctl(int pid, int code, unsigned long *addr); | 306 | extern int os_arch_prctl(int pid, int option, unsigned long *addr); |
307 | 307 | ||
308 | /* tty.c */ | 308 | /* tty.c */ |
309 | extern int get_pty(void); | 309 | extern int get_pty(void); |
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h index 9b9b30b19441..91675a960391 100644 --- a/arch/x86/include/asm/proto.h +++ b/arch/x86/include/asm/proto.h | |||
@@ -30,6 +30,6 @@ void x86_report_nx(void); | |||
30 | 30 | ||
31 | extern int reboot_force; | 31 | extern int reboot_force; |
32 | 32 | ||
33 | long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); | 33 | long do_arch_prctl(struct task_struct *task, int option, unsigned long addr); |
34 | 34 | ||
35 | #endif /* _ASM_X86_PROTO_H */ | 35 | #endif /* _ASM_X86_PROTO_H */ |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index d6b784a5520d..4377cfe8e449 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -547,13 +547,13 @@ static long prctl_map_vdso(const struct vdso_image *image, unsigned long addr) | |||
547 | } | 547 | } |
548 | #endif | 548 | #endif |
549 | 549 | ||
550 | long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) | 550 | long do_arch_prctl(struct task_struct *task, int option, unsigned long addr) |
551 | { | 551 | { |
552 | int ret = 0; | 552 | int ret = 0; |
553 | int doit = task == current; | 553 | int doit = task == current; |
554 | int cpu; | 554 | int cpu; |
555 | 555 | ||
556 | switch (code) { | 556 | switch (option) { |
557 | case ARCH_SET_GS: | 557 | case ARCH_SET_GS: |
558 | if (addr >= TASK_SIZE_MAX) | 558 | if (addr >= TASK_SIZE_MAX) |
559 | return -EPERM; | 559 | return -EPERM; |
@@ -621,9 +621,9 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) | |||
621 | return ret; | 621 | return ret; |
622 | } | 622 | } |
623 | 623 | ||
624 | long sys_arch_prctl(int code, unsigned long addr) | 624 | long sys_arch_prctl(int option, unsigned long addr) |
625 | { | 625 | { |
626 | return do_arch_prctl(current, code, addr); | 626 | return do_arch_prctl(current, option, addr); |
627 | } | 627 | } |
628 | 628 | ||
629 | unsigned long KSTK_ESP(struct task_struct *task) | 629 | unsigned long KSTK_ESP(struct task_struct *task) |
diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h index e59eef20647b..b291ca5cf66b 100644 --- a/arch/x86/um/asm/ptrace.h +++ b/arch/x86/um/asm/ptrace.h | |||
@@ -78,7 +78,7 @@ static inline int ptrace_set_thread_area(struct task_struct *child, int idx, | |||
78 | return -ENOSYS; | 78 | return -ENOSYS; |
79 | } | 79 | } |
80 | 80 | ||
81 | extern long arch_prctl(struct task_struct *task, int code, | 81 | extern long arch_prctl(struct task_struct *task, int option, |
82 | unsigned long __user *addr); | 82 | unsigned long __user *addr); |
83 | 83 | ||
84 | #endif | 84 | #endif |
diff --git a/arch/x86/um/os-Linux/prctl.c b/arch/x86/um/os-Linux/prctl.c index 96eb2bd28832..0a6e16a35b77 100644 --- a/arch/x86/um/os-Linux/prctl.c +++ b/arch/x86/um/os-Linux/prctl.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <sys/ptrace.h> | 6 | #include <sys/ptrace.h> |
7 | #include <asm/ptrace.h> | 7 | #include <asm/ptrace.h> |
8 | 8 | ||
9 | int os_arch_prctl(int pid, int code, unsigned long *addr) | 9 | int os_arch_prctl(int pid, int option, unsigned long *addr) |
10 | { | 10 | { |
11 | return ptrace(PTRACE_ARCH_PRCTL, pid, (unsigned long) addr, code); | 11 | return ptrace(PTRACE_ARCH_PRCTL, pid, (unsigned long) addr, option); |
12 | } | 12 | } |
diff --git a/arch/x86/um/syscalls_64.c b/arch/x86/um/syscalls_64.c index 10d907098c26..3c2dd8768992 100644 --- a/arch/x86/um/syscalls_64.c +++ b/arch/x86/um/syscalls_64.c | |||
@@ -11,7 +11,8 @@ | |||
11 | #include <asm/prctl.h> /* XXX This should get the constants from libc */ | 11 | #include <asm/prctl.h> /* XXX This should get the constants from libc */ |
12 | #include <os.h> | 12 | #include <os.h> |
13 | 13 | ||
14 | long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) | 14 | long arch_prctl(struct task_struct *task, int option |
15 | unsigned long __user *addr) | ||
15 | { | 16 | { |
16 | unsigned long *ptr = addr, tmp; | 17 | unsigned long *ptr = addr, tmp; |
17 | long ret; | 18 | long ret; |
@@ -30,7 +31,7 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) | |||
30 | * arch_prctl is run on the host, then the registers are read | 31 | * arch_prctl is run on the host, then the registers are read |
31 | * back. | 32 | * back. |
32 | */ | 33 | */ |
33 | switch (code) { | 34 | switch (option) { |
34 | case ARCH_SET_FS: | 35 | case ARCH_SET_FS: |
35 | case ARCH_SET_GS: | 36 | case ARCH_SET_GS: |
36 | ret = restore_registers(pid, ¤t->thread.regs.regs); | 37 | ret = restore_registers(pid, ¤t->thread.regs.regs); |
@@ -50,11 +51,11 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) | |||
50 | ptr = &tmp; | 51 | ptr = &tmp; |
51 | } | 52 | } |
52 | 53 | ||
53 | ret = os_arch_prctl(pid, code, ptr); | 54 | ret = os_arch_prctl(pid, option, ptr); |
54 | if (ret) | 55 | if (ret) |
55 | return ret; | 56 | return ret; |
56 | 57 | ||
57 | switch (code) { | 58 | switch (option) { |
58 | case ARCH_SET_FS: | 59 | case ARCH_SET_FS: |
59 | current->thread.arch.fs = (unsigned long) ptr; | 60 | current->thread.arch.fs = (unsigned long) ptr; |
60 | ret = save_registers(pid, ¤t->thread.regs.regs); | 61 | ret = save_registers(pid, ¤t->thread.regs.regs); |
@@ -73,9 +74,9 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) | |||
73 | return ret; | 74 | return ret; |
74 | } | 75 | } |
75 | 76 | ||
76 | long sys_arch_prctl(int code, unsigned long addr) | 77 | long sys_arch_prctl(int option, unsigned long addr) |
77 | { | 78 | { |
78 | return arch_prctl(current, code, (unsigned long __user *) addr); | 79 | return arch_prctl(current, option, (unsigned long __user *) addr); |
79 | } | 80 | } |
80 | 81 | ||
81 | void arch_switch_to(struct task_struct *to) | 82 | void arch_switch_to(struct task_struct *to) |