From: Arnd Bergmann , Randy Dunlap I've built kernels for s390 and x86_64. This is the patch I used to fix up the warnings. --- 25-akpm/arch/s390/kernel/compat_linux.c | 47 ++++++++++++------------------ 25-akpm/arch/s390/kernel/compat_wrapper.S | 6 ++- 25-akpm/arch/s390/kernel/sys_s390.c | 4 -- 25-akpm/arch/x86_64/ia32/sys_ia32.c | 9 ++--- 25-akpm/include/asm-x86_64/proto.h | 1 25-akpm/include/asm-x86_64/unistd.h | 4 +- 6 files changed, 30 insertions(+), 41 deletions(-) diff -puN arch/s390/kernel/compat_linux.c~add-syscalls_h-4 arch/s390/kernel/compat_linux.c --- 25/arch/s390/kernel/compat_linux.c~add-syscalls_h-4 Mon Feb 9 11:46:06 2004 +++ 25-akpm/arch/s390/kernel/compat_linux.c Mon Feb 9 11:46:06 2004 @@ -1557,7 +1557,7 @@ struct sysinfo32 { char _f[8]; }; -asmlinkage int sys32_sysinfo(struct sysinfo32 *info) +asmlinkage int sys32_sysinfo(struct sysinfo32 __user *info) { struct sysinfo s; int ret, err; @@ -1586,7 +1586,7 @@ asmlinkage int sys32_sysinfo(struct sysi } asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, - struct compat_timespec *interval) + struct compat_timespec __user *interval) { struct timespec t; int ret; @@ -1600,7 +1600,8 @@ asmlinkage int sys32_sched_rr_get_interv return ret; } -asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize) +asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, + compat_sigset_t __user *oset, compat_size_t sigsetsize) { sigset_t s; compat_sigset_t s32; @@ -1634,7 +1635,8 @@ asmlinkage int sys32_rt_sigprocmask(int return 0; } -asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize) +asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *set, + compat_size_t sigsetsize) { sigset_t s; compat_sigset_t s32; @@ -1742,7 +1744,7 @@ sys32_rt_sigtimedwait(compat_sigset_t *u } asmlinkage int -sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo) +sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo) { siginfo_t info; int ret; @@ -1971,40 +1973,30 @@ out: #ifdef CONFIG_MODULES -extern asmlinkage int sys_init_module(const char *name_user, struct module *mod_user); - -/* Hey, when you're trying to init module, take time and prepare us a nice 64bit - * module structure, even if from 32bit modutils... Why to pollute kernel... :)) - */ -asmlinkage int sys32_init_module(const char *name_user, struct module *mod_user) +asmlinkage int +sys32_init_module(void __user *umod, unsigned long len, + const char __user *uargs) { - return sys_init_module(name_user, mod_user); + return sys_init_module(umod, len, uargs); } -extern asmlinkage int sys_delete_module(const char *name_user); - -asmlinkage int sys32_delete_module(const char *name_user) +asmlinkage int +sys32_delete_module(const char __user *name_user, unsigned int flags) { - return sys_delete_module(name_user); + return sys_delete_module(name_user, flags); } -struct module_info32 { - u32 addr; - u32 size; - u32 flags; - s32 usecount; -}; - #else /* CONFIG_MODULES */ asmlinkage int -sys32_init_module(const char *name_user, struct module *mod_user) +sys32_init_module(void __user *umod, unsigned long len, + const char __user *uargs) { return -ENOSYS; } asmlinkage int -sys32_delete_module(const char *name_user) +sys32_delete_module(const char __user *name_user, unsigned int flags) { return -ENOSYS; } @@ -2282,7 +2274,8 @@ asmlinkage int sys32_settimeofday(struct return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); } -asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs) +asmlinkage int sys32_utimes(char __user *filename, + struct compat_timeval __user *tvs) { char *kfilename; struct timeval ktvs[2]; @@ -2477,7 +2470,7 @@ struct __sysctl_args32 { u32 __unused[4]; }; -extern asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) +asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) { struct __sysctl_args32 tmp; int error; diff -puN arch/s390/kernel/compat_wrapper.S~add-syscalls_h-4 arch/s390/kernel/compat_wrapper.S --- 25/arch/s390/kernel/compat_wrapper.S~add-syscalls_h-4 Mon Feb 9 11:46:06 2004 +++ 25-akpm/arch/s390/kernel/compat_wrapper.S Mon Feb 9 11:46:06 2004 @@ -567,13 +567,15 @@ compat_sys_sigprocmask_wrapper: .globl sys32_init_module_wrapper sys32_init_module_wrapper: - llgtr %r2,%r2 # const char * - llgtr %r3,%r3 # struct module * + llgtr %r2,%r2 # void * + llgfr %r3,%r3 # unsigned long + llgtr %r4,%r4 # char * jg sys32_init_module # branch to system call .globl sys32_delete_module_wrapper sys32_delete_module_wrapper: llgtr %r2,%r2 # const char * + llgfr %r3,%r3 # unsigned int jg sys32_delete_module # branch to system call .globl sys32_quotactl_wrapper diff -puN arch/s390/kernel/sys_s390.c~add-syscalls_h-4 arch/s390/kernel/sys_s390.c --- 25/arch/s390/kernel/sys_s390.c~add-syscalls_h-4 Mon Feb 9 11:46:06 2004 +++ 25-akpm/arch/s390/kernel/sys_s390.c Mon Feb 9 11:46:06 2004 @@ -326,8 +326,6 @@ asmlinkage int s390x_personality(unsigne */ #ifndef CONFIG_ARCH_S390X -extern asmlinkage long sys_fadvise64(int, loff_t, size_t, int); - asmlinkage long s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice) { @@ -337,8 +335,6 @@ s390_fadvise64(int fd, u32 offset_high, #endif -extern asmlinkage long sys_fadvise64_64(int, loff_t, loff_t, int); - struct fadvise64_64_args { int fd; long long offset; diff -puN arch/x86_64/ia32/sys_ia32.c~add-syscalls_h-4 arch/x86_64/ia32/sys_ia32.c --- 25/arch/x86_64/ia32/sys_ia32.c~add-syscalls_h-4 Mon Feb 9 11:46:06 2004 +++ 25-akpm/arch/x86_64/ia32/sys_ia32.c Mon Feb 9 11:46:06 2004 @@ -360,8 +360,8 @@ sys32_sigaction (int sig, struct old_sig } asmlinkage long -sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, - unsigned int sigsetsize) +sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, + compat_sigset_t __user *oset, unsigned int sigsetsize) { sigset_t s; compat_sigset_t s32; @@ -989,7 +989,7 @@ sys32_sched_rr_get_interval(compat_pid_t } asmlinkage long -sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize) +sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize) { sigset_t s; compat_sigset_t s32; @@ -1335,7 +1335,7 @@ long sys32_uname(struct old_utsname * na return err?-EFAULT:0; } -long sys32_ustat(unsigned dev, struct ustat32 *u32p) +long sys32_ustat(unsigned dev, struct ustat32 __user *u32p) { struct ustat u; mm_segment_t seg; @@ -1690,7 +1690,6 @@ done: return err; } #else /* !NFSD */ -extern asmlinkage long sys_ni_syscall(void); long asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2) { return sys_ni_syscall(); diff -puN include/asm-x86_64/proto.h~add-syscalls_h-4 include/asm-x86_64/proto.h --- 25/include/asm-x86_64/proto.h~add-syscalls_h-4 Mon Feb 9 11:46:06 2004 +++ 25-akpm/include/asm-x86_64/proto.h Mon Feb 9 11:46:06 2004 @@ -24,7 +24,6 @@ extern void ia32_cstar_target(void); extern void calibrate_delay(void); extern void cpu_idle(void); -extern void sys_ni_syscall(void); extern void config_acpi_tables(void); extern void ia32_syscall(void); extern void iommu_hole_init(void); diff -puN include/asm-x86_64/unistd.h~add-syscalls_h-4 include/asm-x86_64/unistd.h --- 25/include/asm-x86_64/unistd.h~add-syscalls_h-4 Mon Feb 9 11:46:06 2004 +++ 25-akpm/include/asm-x86_64/unistd.h Mon Feb 9 11:46:06 2004 @@ -553,8 +553,6 @@ do { \ #ifndef __KERNEL_SYSCALLS__ -#include - #define __syscall "syscall" #define _syscall0(type,name) \ @@ -638,6 +636,8 @@ __syscall_return(type,__res); \ #else /* __KERNEL_SYSCALLS__ */ +#include + /* * we need this inline - forking from kernel space will result * in NO COPY ON WRITE (!!!), until an execve is executed. This _