aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:46:26 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:47:06 -0400
commita806170e29c5468b1d641a22518243bdf1b8d58b (patch)
tree0b1661f287d6e2b711bbd7600120a250a4f57549 /arch/s390
parent5a62b192196af9a798e2f2f4c6a1324e7edf2f4b (diff)
[S390] Fix a lot of sparse warnings.
Most noteable part of this commit is the new local header file entry.h which contains all the function declarations of functions that get only called from asm code or are arch internal. That way we can avoid extern declarations in C files. This is more or less the same that was done for sparc64. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/compat_linux.h73
-rw-r--r--arch/s390/kernel/compat_signal.c1
-rw-r--r--arch/s390/kernel/debug.c2
-rw-r--r--arch/s390/kernel/early.c1
-rw-r--r--arch/s390/kernel/entry.h60
-rw-r--r--arch/s390/kernel/ipl.c2
-rw-r--r--arch/s390/kernel/kprobes.c2
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/s390/kernel/ptrace.c1
-rw-r--r--arch/s390/kernel/s390_ext.c1
-rw-r--r--arch/s390/kernel/signal.c6
-rw-r--r--arch/s390/kernel/smp.c3
-rw-r--r--arch/s390/kernel/sys_s390.c2
-rw-r--r--arch/s390/kernel/time.c1
-rw-r--r--arch/s390/kernel/traps.c5
-rw-r--r--arch/s390/mm/fault.c13
16 files changed, 151 insertions, 24 deletions
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index e89f8c0c42a0..20723a062017 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -162,4 +162,77 @@ struct ucontext32 {
162 compat_sigset_t uc_sigmask; /* mask last for extensibility */ 162 compat_sigset_t uc_sigmask; /* mask last for extensibility */
163}; 163};
164 164
165struct __sysctl_args32;
166struct stat64_emu31;
167struct mmap_arg_struct_emu31;
168struct fadvise64_64_args;
169struct old_sigaction32;
170struct old_sigaction32;
171
172long sys32_chown16(const char __user * filename, u16 user, u16 group);
173long sys32_lchown16(const char __user * filename, u16 user, u16 group);
174long sys32_fchown16(unsigned int fd, u16 user, u16 group);
175long sys32_setregid16(u16 rgid, u16 egid);
176long sys32_setgid16(u16 gid);
177long sys32_setreuid16(u16 ruid, u16 euid);
178long sys32_setuid16(u16 uid);
179long sys32_setresuid16(u16 ruid, u16 euid, u16 suid);
180long sys32_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid);
181long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid);
182long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid);
183long sys32_setfsuid16(u16 uid);
184long sys32_setfsgid16(u16 gid);
185long sys32_getgroups16(int gidsetsize, u16 __user *grouplist);
186long sys32_setgroups16(int gidsetsize, u16 __user *grouplist);
187long sys32_getuid16(void);
188long sys32_geteuid16(void);
189long sys32_getgid16(void);
190long sys32_getegid16(void);
191long sys32_ipc(u32 call, int first, int second, int third, u32 ptr);
192long sys32_truncate64(const char __user * path, unsigned long high,
193 unsigned long low);
194long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low);
195long sys32_sched_rr_get_interval(compat_pid_t pid,
196 struct compat_timespec __user *interval);
197long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
198 compat_sigset_t __user *oset, size_t sigsetsize);
199long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize);
200long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo);
201long sys32_execve(void);
202long sys32_init_module(void __user *umod, unsigned long len,
203 const char __user *uargs);
204long sys32_delete_module(const char __user *name_user, unsigned int flags);
205long sys32_gettimeofday(struct compat_timeval __user *tv,
206 struct timezone __user *tz);
207long sys32_settimeofday(struct compat_timeval __user *tv,
208 struct timezone __user *tz);
209long sys32_pause(void);
210long sys32_pread64(unsigned int fd, char __user *ubuf, size_t count,
211 u32 poshi, u32 poslo);
212long sys32_pwrite64(unsigned int fd, const char __user *ubuf,
213 size_t count, u32 poshi, u32 poslo);
214compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count);
215long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
216 size_t count);
217long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
218 s32 count);
219long sys32_sysctl(struct __sysctl_args32 __user *args);
220long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
221long sys32_lstat64(char __user * filename,
222 struct stat64_emu31 __user * statbuf);
223long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf);
224long sys32_fstatat64(unsigned int dfd, char __user *filename,
225 struct stat64_emu31 __user* statbuf, int flag);
226unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg);
227long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg);
228long sys32_read(unsigned int fd, char __user * buf, size_t count);
229long sys32_write(unsigned int fd, char __user * buf, size_t count);
230long sys32_clone(void);
231long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise);
232long sys32_fadvise64_64(struct fadvise64_64_args __user *args);
233long sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
234 struct old_sigaction32 __user *oact);
235long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
236 struct sigaction32 __user *oact, size_t sigsetsize);
237long sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss);
165#endif /* _ASM_S390X_S390_H */ 238#endif /* _ASM_S390X_S390_H */
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index ae2f2d313930..c7f02e777af2 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -29,6 +29,7 @@
29#include <asm/lowcore.h> 29#include <asm/lowcore.h>
30#include "compat_linux.h" 30#include "compat_linux.h"
31#include "compat_ptrace.h" 31#include "compat_ptrace.h"
32#include "entry.h"
32 33
33#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 34#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
34 35
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 95a46bc008b7..1e7d4ac7068b 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -157,7 +157,7 @@ struct debug_view debug_sprintf_view = {
157}; 157};
158 158
159/* used by dump analysis tools to determine version of debug feature */ 159/* used by dump analysis tools to determine version of debug feature */
160unsigned int debug_feature_version = __DEBUG_FEATURE_VERSION; 160static unsigned int __used debug_feature_version = __DEBUG_FEATURE_VERSION;
161 161
162/* static globals */ 162/* static globals */
163 163
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 01832c440636..540a67f979b6 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -21,6 +21,7 @@
21#include <asm/setup.h> 21#include <asm/setup.h>
22#include <asm/cpcmd.h> 22#include <asm/cpcmd.h>
23#include <asm/sclp.h> 23#include <asm/sclp.h>
24#include "entry.h"
24 25
25/* 26/*
26 * Create a Kernel NSS if the SAVESYS= parameter is defined 27 * Create a Kernel NSS if the SAVESYS= parameter is defined
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
new file mode 100644
index 000000000000..6b1896345eda
--- /dev/null
+++ b/arch/s390/kernel/entry.h
@@ -0,0 +1,60 @@
1#ifndef _ENTRY_H
2#define _ENTRY_H
3
4#include <linux/types.h>
5#include <linux/signal.h>
6#include <asm/ptrace.h>
7
8typedef void pgm_check_handler_t(struct pt_regs *, long);
9extern pgm_check_handler_t *pgm_check_table[128];
10pgm_check_handler_t do_protection_exception;
11pgm_check_handler_t do_dat_exception;
12
13extern int sysctl_userprocess_debug;
14
15void do_single_step(struct pt_regs *regs);
16void syscall_trace(struct pt_regs *regs, int entryexit);
17void kernel_stack_overflow(struct pt_regs * regs);
18void do_signal(struct pt_regs *regs);
19int handle_signal32(unsigned long sig, struct k_sigaction *ka,
20 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs);
21
22void do_extint(struct pt_regs *regs, unsigned short code);
23int __cpuinit start_secondary(void *cpuvoid);
24void __init startup_init(void);
25void die(const char * str, struct pt_regs * regs, long err);
26
27struct new_utsname;
28struct mmap_arg_struct;
29struct fadvise64_64_args;
30struct old_sigaction;
31struct sel_arg_struct;
32
33long sys_pipe(unsigned long __user *fildes);
34long sys_mmap2(struct mmap_arg_struct __user *arg);
35long old_mmap(struct mmap_arg_struct __user *arg);
36long sys_ipc(uint call, int first, unsigned long second,
37 unsigned long third, void __user *ptr);
38long s390x_newuname(struct new_utsname __user *name);
39long s390x_personality(unsigned long personality);
40long s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
41 size_t len, int advice);
42long s390_fadvise64_64(struct fadvise64_64_args __user *args);
43long s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, u32 len_low);
44long sys_fork(void);
45long sys_clone(void);
46long sys_vfork(void);
47void execve_tail(void);
48long sys_execve(void);
49int sys_sigsuspend(int history0, int history1, old_sigset_t mask);
50long sys_sigaction(int sig, const struct old_sigaction __user *act,
51 struct old_sigaction __user *oact);
52long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss);
53long sys_sigreturn(void);
54long sys_rt_sigreturn(void);
55long sys32_sigreturn(void);
56long sys32_rt_sigreturn(void);
57long old_select(struct sel_arg_struct __user *arg);
58long sys_ptrace(long request, long pid, long addr, long data);
59
60#endif /* _ENTRY_H */
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 375232c46c7a..532542447d66 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -655,7 +655,7 @@ static struct kobj_attribute reipl_type_attr =
655 655
656static struct kset *reipl_kset; 656static struct kset *reipl_kset;
657 657
658void reipl_run(struct shutdown_trigger *trigger) 658static void reipl_run(struct shutdown_trigger *trigger)
659{ 659{
660 struct ccw_dev_id devid; 660 struct ccw_dev_id devid;
661 static char buf[100]; 661 static char buf[100];
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index c5549a206284..ed04d1372d5d 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -360,7 +360,7 @@ no_kprobe:
360 * - When the probed function returns, this probe 360 * - When the probed function returns, this probe
361 * causes the handlers to fire 361 * causes the handlers to fire
362 */ 362 */
363void kretprobe_trampoline_holder(void) 363static void __used kretprobe_trampoline_holder(void)
364{ 364{
365 asm volatile(".global kretprobe_trampoline\n" 365 asm volatile(".global kretprobe_trampoline\n"
366 "kretprobe_trampoline: bcr 0,0\n"); 366 "kretprobe_trampoline: bcr 0,0\n");
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index df033249f6b1..dbefd0db395f 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -37,6 +37,7 @@
37#include <linux/notifier.h> 37#include <linux/notifier.h>
38#include <linux/utsname.h> 38#include <linux/utsname.h>
39#include <linux/tick.h> 39#include <linux/tick.h>
40#include <linux/elfcore.h>
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/pgtable.h> 42#include <asm/pgtable.h>
42#include <asm/system.h> 43#include <asm/system.h>
@@ -45,6 +46,7 @@
45#include <asm/irq.h> 46#include <asm/irq.h>
46#include <asm/timer.h> 47#include <asm/timer.h>
47#include <asm/cpu.h> 48#include <asm/cpu.h>
49#include "entry.h"
48 50
49asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 51asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
50 52
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 6e036bae9875..58a064296987 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -41,6 +41,7 @@
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <asm/unistd.h> 43#include <asm/unistd.h>
44#include "entry.h"
44 45
45#ifdef CONFIG_COMPAT 46#ifdef CONFIG_COMPAT
46#include "compat_ptrace.h" 47#include "compat_ptrace.h"
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index 947d8c74403b..e019b419efc6 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -18,6 +18,7 @@
18#include <asm/s390_ext.h> 18#include <asm/s390_ext.h>
19#include <asm/irq_regs.h> 19#include <asm/irq_regs.h>
20#include <asm/irq.h> 20#include <asm/irq.h>
21#include "entry.h"
21 22
22/* 23/*
23 * ext_int_hash[index] is the start of the list for all external interrupts 24 * ext_int_hash[index] is the start of the list for all external interrupts
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 8c92191949c2..b97682040215 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -27,6 +27,7 @@
27#include <asm/ucontext.h> 27#include <asm/ucontext.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/lowcore.h> 29#include <asm/lowcore.h>
30#include "entry.h"
30 31
31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32 33
@@ -484,11 +485,6 @@ void do_signal(struct pt_regs *regs)
484 int ret; 485 int ret;
485#ifdef CONFIG_COMPAT 486#ifdef CONFIG_COMPAT
486 if (test_thread_flag(TIF_31BIT)) { 487 if (test_thread_flag(TIF_31BIT)) {
487 extern int handle_signal32(unsigned long sig,
488 struct k_sigaction *ka,
489 siginfo_t *info,
490 sigset_t *oldset,
491 struct pt_regs *regs);
492 ret = handle_signal32(signr, &ka, &info, oldset, regs); 488 ret = handle_signal32(signr, &ka, &info, oldset, regs);
493 } 489 }
494 else 490 else
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 5a445b1b1217..0dfa988c1b26 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -44,6 +44,7 @@
44#include <asm/lowcore.h> 44#include <asm/lowcore.h>
45#include <asm/sclp.h> 45#include <asm/sclp.h>
46#include <asm/cpu.h> 46#include <asm/cpu.h>
47#include "entry.h"
47 48
48/* 49/*
49 * An array with a pointer the lowcore of every CPU. 50 * An array with a pointer the lowcore of every CPU.
@@ -297,7 +298,7 @@ static void smp_ext_bitcall(int cpu, ec_bit_sig sig)
297/* 298/*
298 * this function sends a 'purge tlb' signal to another CPU. 299 * this function sends a 'purge tlb' signal to another CPU.
299 */ 300 */
300void smp_ptlb_callback(void *info) 301static void smp_ptlb_callback(void *info)
301{ 302{
302 __tlb_flush_local(); 303 __tlb_flush_local();
303} 304}
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index fefee99f28aa..988d0d64c2c8 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -29,8 +29,8 @@
29#include <linux/personality.h> 29#include <linux/personality.h>
30#include <linux/unistd.h> 30#include <linux/unistd.h>
31#include <linux/ipc.h> 31#include <linux/ipc.h>
32
33#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include "entry.h"
34 34
35/* 35/*
36 * sys_pipe() is the normal C calling standard for creating 36 * sys_pipe() is the normal C calling standard for creating
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 17c4de9e1b6b..7aec676fefd5 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -39,6 +39,7 @@
39#include <asm/irq_regs.h> 39#include <asm/irq_regs.h>
40#include <asm/timer.h> 40#include <asm/timer.h>
41#include <asm/etr.h> 41#include <asm/etr.h>
42#include <asm/cio.h>
42 43
43/* change this if you have some constant time drift */ 44/* change this if you have some constant time drift */
44#define USECS_PER_JIFFY ((unsigned long) 1000000/HZ) 45#define USECS_PER_JIFFY ((unsigned long) 1000000/HZ)
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 9452a205629b..b3524134f213 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -42,11 +42,8 @@
42#include <asm/s390_ext.h> 42#include <asm/s390_ext.h>
43#include <asm/lowcore.h> 43#include <asm/lowcore.h>
44#include <asm/debug.h> 44#include <asm/debug.h>
45#include "entry.h"
45 46
46/* Called from entry.S only */
47extern void handle_per_exception(struct pt_regs *regs);
48
49typedef void pgm_check_handler_t(struct pt_regs *, long);
50pgm_check_handler_t *pgm_check_table[128]; 47pgm_check_handler_t *pgm_check_table[128];
51 48
52#ifdef CONFIG_SYSCTL 49#ifdef CONFIG_SYSCTL
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index a9c635f01db8..2650f46001d0 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -28,11 +28,11 @@
28#include <linux/hardirq.h> 28#include <linux/hardirq.h>
29#include <linux/kprobes.h> 29#include <linux/kprobes.h>
30#include <linux/uaccess.h> 30#include <linux/uaccess.h>
31
32#include <asm/system.h> 31#include <asm/system.h>
33#include <asm/pgtable.h> 32#include <asm/pgtable.h>
34#include <asm/s390_ext.h> 33#include <asm/s390_ext.h>
35#include <asm/mmu_context.h> 34#include <asm/mmu_context.h>
35#include "../kernel/entry.h"
36 36
37#ifndef CONFIG_64BIT 37#ifndef CONFIG_64BIT
38#define __FAIL_ADDR_MASK 0x7ffff000 38#define __FAIL_ADDR_MASK 0x7ffff000
@@ -50,8 +50,6 @@
50extern int sysctl_userprocess_debug; 50extern int sysctl_userprocess_debug;
51#endif 51#endif
52 52
53extern void die(const char *,struct pt_regs *,long);
54
55#ifdef CONFIG_KPROBES 53#ifdef CONFIG_KPROBES
56static inline int notify_page_fault(struct pt_regs *regs, long err) 54static inline int notify_page_fault(struct pt_regs *regs, long err)
57{ 55{
@@ -245,11 +243,6 @@ static void do_sigbus(struct pt_regs *regs, unsigned long error_code,
245} 243}
246 244
247#ifdef CONFIG_S390_EXEC_PROTECT 245#ifdef CONFIG_S390_EXEC_PROTECT
248extern long sys_sigreturn(void);
249extern long sys_rt_sigreturn(void);
250extern long sys32_sigreturn(void);
251extern long sys32_rt_sigreturn(void);
252
253static int signal_return(struct mm_struct *mm, struct pt_regs *regs, 246static int signal_return(struct mm_struct *mm, struct pt_regs *regs,
254 unsigned long address, unsigned long error_code) 247 unsigned long address, unsigned long error_code)
255{ 248{
@@ -424,7 +417,7 @@ no_context:
424} 417}
425 418
426void __kprobes do_protection_exception(struct pt_regs *regs, 419void __kprobes do_protection_exception(struct pt_regs *regs,
427 unsigned long error_code) 420 long error_code)
428{ 421{
429 /* Protection exception is supressing, decrement psw address. */ 422 /* Protection exception is supressing, decrement psw address. */
430 regs->psw.addr -= (error_code >> 16); 423 regs->psw.addr -= (error_code >> 16);
@@ -440,7 +433,7 @@ void __kprobes do_protection_exception(struct pt_regs *regs,
440 do_exception(regs, 4, 1); 433 do_exception(regs, 4, 1);
441} 434}
442 435
443void __kprobes do_dat_exception(struct pt_regs *regs, unsigned long error_code) 436void __kprobes do_dat_exception(struct pt_regs *regs, long error_code)
444{ 437{
445 do_exception(regs, error_code & 0xff, 0); 438 do_exception(regs, error_code & 0xff, 0);
446} 439}