aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-10 18:21:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:32 -0500
commite28cbf22933d0c0ccaf3c4c27a1a263b41f73859 (patch)
treea93ff48cfd97766a23b2c4f3ea86fccfc9c51d3f /arch/sparc
parentbaed7fc9b580bd3fb8252ff1d9b36eaf1f86b670 (diff)
improve sys_newuname() for compat architectures
On an architecture that supports 32-bit compat we need to override the reported machine in uname with the 32-bit value. Instead of doing this separately in every architecture introduce a COMPAT_UTS_MACHINE define in <asm/compat.h> and apply it directly in sys_newuname(). Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Jeff Dike <jdike@addtoit.com> Cc: Hirokazu Takata <takata@linux-m32r.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: James Morris <jmorris@namei.org> Cc: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/compat.h3
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c11
-rw-r--r--arch/sparc/kernel/systbls.h3
-rw-r--r--arch/sparc/kernel/systbls_64.S4
4 files changed, 4 insertions, 17 deletions
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 0e706257918f..5016f76ea98a 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -5,7 +5,8 @@
5 */ 5 */
6#include <linux/types.h> 6#include <linux/types.h>
7 7
8#define COMPAT_USER_HZ 100 8#define COMPAT_USER_HZ 100
9#define COMPAT_UTS_MACHINE "sparc\0\0"
9 10
10typedef u32 compat_size_t; 11typedef u32 compat_size_t;
11typedef s32 compat_ssize_t; 12typedef s32 compat_ssize_t;
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 45410e939628..3d435c42e6db 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -510,17 +510,6 @@ out:
510 return err; 510 return err;
511} 511}
512 512
513SYSCALL_DEFINE1(sparc64_newuname, struct new_utsname __user *, name)
514{
515 int ret = sys_newuname(name);
516
517 if (current->personality == PER_LINUX32 && !ret) {
518 ret = (copy_to_user(name->machine, "sparc\0\0", 8)
519 ? -EFAULT : 0);
520 }
521 return ret;
522}
523
524SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality) 513SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality)
525{ 514{
526 int ret; 515 int ret;
diff --git a/arch/sparc/kernel/systbls.h b/arch/sparc/kernel/systbls.h
index 2c331c37e748..118759cd7342 100644
--- a/arch/sparc/kernel/systbls.h
+++ b/arch/sparc/kernel/systbls.h
@@ -6,15 +6,12 @@
6#include <asm/utrap.h> 6#include <asm/utrap.h>
7#include <asm/signal.h> 7#include <asm/signal.h>
8 8
9struct new_utsname;
10
11extern asmlinkage unsigned long sys_getpagesize(void); 9extern asmlinkage unsigned long sys_getpagesize(void);
12extern asmlinkage long sparc_pipe(struct pt_regs *regs); 10extern asmlinkage long sparc_pipe(struct pt_regs *regs);
13extern asmlinkage long sys_sparc_ipc(unsigned int call, int first, 11extern asmlinkage long sys_sparc_ipc(unsigned int call, int first,
14 unsigned long second, 12 unsigned long second,
15 unsigned long third, 13 unsigned long third,
16 void __user *ptr, long fifth); 14 void __user *ptr, long fifth);
17extern asmlinkage long sparc64_newuname(struct new_utsname __user *name);
18extern asmlinkage long sparc64_personality(unsigned long personality); 15extern asmlinkage long sparc64_personality(unsigned long personality);
19extern asmlinkage long sys64_munmap(unsigned long addr, size_t len); 16extern asmlinkage long sys64_munmap(unsigned long addr, size_t len);
20extern asmlinkage unsigned long sys64_mremap(unsigned long addr, 17extern asmlinkage unsigned long sys64_mremap(unsigned long addr,
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 30ca2b1d3a17..9db058dd039e 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -55,7 +55,7 @@ sys_call_table32:
55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents 55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr 56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall 57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
58 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_sparc64_newuname 58 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_newuname
59/*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl 59/*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
60 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask 60 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask
61/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir 61/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
@@ -130,7 +130,7 @@ sys_call_table:
130/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents 130/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
131 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr 131 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
132/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall 132/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
133 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_sparc64_newuname 133 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
134/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl 134/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
135 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask 135 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
136/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall 136/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall