aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-12-08 04:04:59 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-08 04:04:59 -0500
commit8d74e32a537e8dbb22a1d5e9005d11111dab979a (patch)
tree0a5919ff70abb19060e707754f85a0875b3adb04 /arch/sparc
parent85bfbf44c37e403d4fcbcd630b3ca2377b156485 (diff)
sparc: fix sparse warnings in traps_32.c
o add decalrations to entry.h for functions only used from assembler o add declaratiosn to kernel.h for functions only used from .c o removed unused functions/extern declarations Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/entry.h35
-rw-r--r--arch/sparc/kernel/kernel.h9
-rw-r--r--arch/sparc/kernel/muldiv.c5
-rw-r--r--arch/sparc/kernel/traps_32.c34
4 files changed, 49 insertions, 34 deletions
diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h
index a9ab19aa0411..06db4f18e453 100644
--- a/arch/sparc/kernel/entry.h
+++ b/arch/sparc/kernel/entry.h
@@ -5,6 +5,40 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/init.h> 6#include <linux/init.h>
7 7
8#ifdef CONFIG_SPARC32
9/* traps */
10extern void do_hw_interrupt(struct pt_regs *regs, unsigned long type);
11extern void do_illegal_instruction(struct pt_regs *regs, unsigned long pc,
12 unsigned long npc, unsigned long psr);
13
14extern void do_priv_instruction(struct pt_regs *regs, unsigned long pc,
15 unsigned long npc, unsigned long psr);
16extern void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc,
17 unsigned long npc,
18 unsigned long psr);
19extern void do_fpd_trap(struct pt_regs *regs, unsigned long pc,
20 unsigned long npc, unsigned long psr);
21extern void do_fpe_trap(struct pt_regs *regs, unsigned long pc,
22 unsigned long npc, unsigned long psr);
23extern void handle_tag_overflow(struct pt_regs *regs, unsigned long pc,
24 unsigned long npc, unsigned long psr);
25extern void handle_watchpoint(struct pt_regs *regs, unsigned long pc,
26 unsigned long npc, unsigned long psr);
27extern void handle_reg_access(struct pt_regs *regs, unsigned long pc,
28 unsigned long npc, unsigned long psr);
29extern void handle_cp_disabled(struct pt_regs *regs, unsigned long pc,
30 unsigned long npc, unsigned long psr);
31extern void handle_cp_exception(struct pt_regs *regs, unsigned long pc,
32 unsigned long npc, unsigned long psr);
33
34
35
36/* entry.S */
37extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
38 void *fpqueue, unsigned long *fpqdepth);
39extern void fpload(unsigned long *fpregs, unsigned long *fsr);
40
41#else /* CONFIG_SPARC32 */
8extern void __init per_cpu_patch(void); 42extern void __init per_cpu_patch(void);
9extern void __init sun4v_patch(void); 43extern void __init sun4v_patch(void);
10extern void __init boot_cpu_id_too_large(int cpu); 44extern void __init boot_cpu_id_too_large(int cpu);
@@ -189,4 +223,5 @@ extern void handler_irq(int irq, struct pt_regs *regs);
189extern void init_irqwork_curcpu(void); 223extern void init_irqwork_curcpu(void);
190extern void __cpuinit sun4v_register_mondo_queues(int this_cpu); 224extern void __cpuinit sun4v_register_mondo_queues(int this_cpu);
191 225
226#endif /* CONFIG_SPARC32 */
192#endif /* _ENTRY_H */ 227#endif /* _ENTRY_H */
diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h
index 7f02aad2e1ab..3fa833843a00 100644
--- a/arch/sparc/kernel/kernel.h
+++ b/arch/sparc/kernel/kernel.h
@@ -4,5 +4,14 @@ extern const char *sparc_fpu_type;
4 4
5extern unsigned int fsr_storage; 5extern unsigned int fsr_storage;
6 6
7#ifdef CONFIG_SPARC32
8/* cpu.c */
7extern void cpu_probe(void); 9extern void cpu_probe(void);
8 10
11/* traps_32.c */
12extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
13 unsigned long npc, unsigned long psr);
14/* muldiv.c */
15extern int do_user_muldiv (struct pt_regs *, unsigned long);
16#else /* CONFIG_SPARC32 */
17#endif
diff --git a/arch/sparc/kernel/muldiv.c b/arch/sparc/kernel/muldiv.c
index e352239e72c8..ba960c02bb55 100644
--- a/arch/sparc/kernel/muldiv.c
+++ b/arch/sparc/kernel/muldiv.c
@@ -17,6 +17,8 @@
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/uaccess.h> 18#include <asm/uaccess.h>
19 19
20#include "kernel.h"
21
20/* #define DEBUG_MULDIV */ 22/* #define DEBUG_MULDIV */
21 23
22static inline int has_imm13(int insn) 24static inline int has_imm13(int insn)
@@ -88,9 +90,6 @@ store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs)
88 return (put_user(result, &win->locals[reg - 16])); 90 return (put_user(result, &win->locals[reg - 16]));
89 } 91 }
90} 92}
91
92extern void handle_hw_divzero (struct pt_regs *regs, unsigned long pc,
93 unsigned long npc, unsigned long psr);
94 93
95/* Should return 0 if mul/div emulation succeeded and SIGILL should 94/* Should return 0 if mul/div emulation succeeded and SIGILL should
96 * not be issued. 95 * not be issued.
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 2b7d50659036..716f3946c494 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -25,31 +25,10 @@
25#include <asm/unistd.h> 25#include <asm/unistd.h>
26#include <asm/traps.h> 26#include <asm/traps.h>
27 27
28/* #define TRAP_DEBUG */ 28#include "entry.h"
29 29#include "kernel.h"
30struct trap_trace_entry {
31 unsigned long pc;
32 unsigned long type;
33};
34
35void syscall_trace_entry(struct pt_regs *regs)
36{
37 printk("%s[%d]: ", current->comm, task_pid_nr(current));
38 printk("scall<%d> (could be %d)\n", (int) regs->u_regs[UREG_G1],
39 (int) regs->u_regs[UREG_I0]);
40}
41
42void syscall_trace_exit(struct pt_regs *regs)
43{
44}
45 30
46void sun4d_nmi(struct pt_regs *regs) 31/* #define TRAP_DEBUG */
47{
48 printk("Aieee: sun4d NMI received!\n");
49 printk("you lose buddy boy...\n");
50 show_regs(regs);
51 prom_halt();
52}
53 32
54static void instruction_dump(unsigned long *pc) 33static void instruction_dump(unsigned long *pc)
55{ 34{
@@ -134,7 +113,6 @@ void do_hw_interrupt(struct pt_regs *regs, unsigned long type)
134void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc, 113void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc,
135 unsigned long psr) 114 unsigned long psr)
136{ 115{
137 extern int do_user_muldiv (struct pt_regs *, unsigned long);
138 siginfo_t info; 116 siginfo_t info;
139 117
140 if(psr & PSR_PS) 118 if(psr & PSR_PS)
@@ -195,10 +173,6 @@ void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, unsigned lon
195 send_sig_info(SIGBUS, &info, current); 173 send_sig_info(SIGBUS, &info, current);
196} 174}
197 175
198extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
199 void *fpqueue, unsigned long *fpqdepth);
200extern void fpload(unsigned long *fpregs, unsigned long *fsr);
201
202static unsigned long init_fsr = 0x0UL; 176static unsigned long init_fsr = 0x0UL;
203static unsigned long init_fregs[32] __attribute__ ((aligned (8))) = 177static unsigned long init_fregs[32] __attribute__ ((aligned (8))) =
204 { ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, 178 { ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, ~0UL, ~0UL,
@@ -456,8 +430,6 @@ void do_BUG(const char *file, int line)
456 * up here so that timer interrupts work during initialization. 430 * up here so that timer interrupts work during initialization.
457 */ 431 */
458 432
459extern void sparc_cpu_startup(void);
460
461void trap_init(void) 433void trap_init(void)
462{ 434{
463 extern void thread_info_offsets_are_bolixed_pete(void); 435 extern void thread_info_offsets_are_bolixed_pete(void);