diff options
author | David S. Miller <davem@davemloft.net> | 2014-04-29 01:12:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-29 01:12:34 -0400 |
commit | 8cf749a8f506b06ebbf090709d64e81af519184b (patch) | |
tree | 60a8018b846b55899be18adf0592adc10f7d4367 | |
parent | 2aafe1a4d451866e3e7b476e2fa0813b69b313c1 (diff) | |
parent | 1bbc90607762de736f58d48714710735c0c34848 (diff) |
Merge branch 'sparc32-sparse'
Sam Ravnborg says:
====================
sparse warning fixes in arch/sparc/
The following patch-set address a lot of sparse warnings
in the sparc32 specific parts of arch/sparc/.
A few sparc64 bits are touched too when code are shared.
Within arch/sparc/mm/ only two warnings remains.
These are related to the return value of of_ioremap() which is __iomem.
Within arch/sparc/kernel/ only three files now produces sparse warnings:
sys_sparc_32.c
time_32.c
auxio_32.c
The fixes was not obvious so the warnings was left for now.
When looking at tadpole.c I was left with the impression that most
of the code was actually unused - but for now I added a "TODO".
This is made on top of 3.15-rc2.
This set replaces the two sets sent the last days.
V2:
- Do not add extern in front of prototypes.
- Tidy up a few changelongs
There are still sparse warnings left that are easy to address.
But this fixes the majority.
====================
42 files changed, 221 insertions, 121 deletions
diff --git a/arch/sparc/include/asm/auxio.h b/arch/sparc/include/asm/auxio.h index 13dc67f03011..3e09a07b77e9 100644 --- a/arch/sparc/include/asm/auxio.h +++ b/arch/sparc/include/asm/auxio.h | |||
@@ -1,5 +1,12 @@ | |||
1 | #ifndef ___ASM_SPARC_AUXIO_H | 1 | #ifndef ___ASM_SPARC_AUXIO_H |
2 | #define ___ASM_SPARC_AUXIO_H | 2 | #define ___ASM_SPARC_AUXIO_H |
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | |||
6 | extern void __iomem *auxio_register; | ||
7 | |||
8 | #endif /* ifndef __ASSEMBLY__ */ | ||
9 | |||
3 | #if defined(__sparc__) && defined(__arch64__) | 10 | #if defined(__sparc__) && defined(__arch64__) |
4 | #include <asm/auxio_64.h> | 11 | #include <asm/auxio_64.h> |
5 | #else | 12 | #else |
diff --git a/arch/sparc/include/asm/auxio_64.h b/arch/sparc/include/asm/auxio_64.h index f61cd1e3e395..7af9766a1c35 100644 --- a/arch/sparc/include/asm/auxio_64.h +++ b/arch/sparc/include/asm/auxio_64.h | |||
@@ -75,8 +75,6 @@ | |||
75 | 75 | ||
76 | #ifndef __ASSEMBLY__ | 76 | #ifndef __ASSEMBLY__ |
77 | 77 | ||
78 | extern void __iomem *auxio_register; | ||
79 | |||
80 | #define AUXIO_LTE_ON 1 | 78 | #define AUXIO_LTE_ON 1 |
81 | #define AUXIO_LTE_OFF 0 | 79 | #define AUXIO_LTE_OFF 0 |
82 | 80 | ||
diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h index 6bd9f43cb5a5..a24cbb16d0eb 100644 --- a/arch/sparc/include/asm/bug.h +++ b/arch/sparc/include/asm/bug.h | |||
@@ -20,6 +20,6 @@ extern void do_BUG(const char *file, int line); | |||
20 | #include <asm-generic/bug.h> | 20 | #include <asm-generic/bug.h> |
21 | 21 | ||
22 | struct pt_regs; | 22 | struct pt_regs; |
23 | extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn)); | 23 | void __noreturn die_if_kernel(char *str, struct pt_regs *regs); |
24 | 24 | ||
25 | #endif | 25 | #endif |
diff --git a/arch/sparc/include/asm/cpudata.h b/arch/sparc/include/asm/cpudata.h index b5976de7cacd..128b56b08676 100644 --- a/arch/sparc/include/asm/cpudata.h +++ b/arch/sparc/include/asm/cpudata.h | |||
@@ -1,5 +1,15 @@ | |||
1 | #ifndef ___ASM_SPARC_CPUDATA_H | 1 | #ifndef ___ASM_SPARC_CPUDATA_H |
2 | #define ___ASM_SPARC_CPUDATA_H | 2 | #define ___ASM_SPARC_CPUDATA_H |
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | |||
6 | #include <linux/threads.h> | ||
7 | #include <linux/percpu.h> | ||
8 | |||
9 | extern const struct seq_operations cpuinfo_op; | ||
10 | |||
11 | #endif /* !(__ASSEMBLY__) */ | ||
12 | |||
3 | #if defined(__sparc__) && defined(__arch64__) | 13 | #if defined(__sparc__) && defined(__arch64__) |
4 | #include <asm/cpudata_64.h> | 14 | #include <asm/cpudata_64.h> |
5 | #else | 15 | #else |
diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h index 050ef35b9dcf..0e594076912c 100644 --- a/arch/sparc/include/asm/cpudata_64.h +++ b/arch/sparc/include/asm/cpudata_64.h | |||
@@ -8,9 +8,6 @@ | |||
8 | 8 | ||
9 | #ifndef __ASSEMBLY__ | 9 | #ifndef __ASSEMBLY__ |
10 | 10 | ||
11 | #include <linux/percpu.h> | ||
12 | #include <linux/threads.h> | ||
13 | |||
14 | typedef struct { | 11 | typedef struct { |
15 | /* Dcache line 1 */ | 12 | /* Dcache line 1 */ |
16 | unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ | 13 | unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ |
@@ -35,8 +32,6 @@ DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); | |||
35 | #define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu)) | 32 | #define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu)) |
36 | #define local_cpu_data() __get_cpu_var(__cpu_data) | 33 | #define local_cpu_data() __get_cpu_var(__cpu_data) |
37 | 34 | ||
38 | extern const struct seq_operations cpuinfo_op; | ||
39 | |||
40 | #endif /* !(__ASSEMBLY__) */ | 35 | #endif /* !(__ASSEMBLY__) */ |
41 | 36 | ||
42 | #include <asm/trap_block.h> | 37 | #include <asm/trap_block.h> |
diff --git a/arch/sparc/include/asm/floppy_32.h b/arch/sparc/include/asm/floppy_32.h index fb3f16954c69..a8af6f00d76d 100644 --- a/arch/sparc/include/asm/floppy_32.h +++ b/arch/sparc/include/asm/floppy_32.h | |||
@@ -9,11 +9,12 @@ | |||
9 | #include <linux/of.h> | 9 | #include <linux/of.h> |
10 | #include <linux/of_device.h> | 10 | #include <linux/of_device.h> |
11 | 11 | ||
12 | #include <asm/page.h> | ||
13 | #include <asm/pgtable.h> | 12 | #include <asm/pgtable.h> |
14 | #include <asm/idprom.h> | 13 | #include <asm/idprom.h> |
15 | #include <asm/oplib.h> | 14 | #include <asm/oplib.h> |
16 | #include <asm/auxio.h> | 15 | #include <asm/auxio.h> |
16 | #include <asm/setup.h> | ||
17 | #include <asm/page.h> | ||
17 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
18 | 19 | ||
19 | /* We don't need no stinkin' I/O port allocation crap. */ | 20 | /* We don't need no stinkin' I/O port allocation crap. */ |
@@ -49,7 +50,6 @@ struct sun_flpy_controller { | |||
49 | 50 | ||
50 | /* You'll only ever find one controller on a SparcStation anyways. */ | 51 | /* You'll only ever find one controller on a SparcStation anyways. */ |
51 | static struct sun_flpy_controller *sun_fdc = NULL; | 52 | static struct sun_flpy_controller *sun_fdc = NULL; |
52 | extern volatile unsigned char *fdc_status; | ||
53 | 53 | ||
54 | struct sun_floppy_ops { | 54 | struct sun_floppy_ops { |
55 | unsigned char (*fd_inb)(int port); | 55 | unsigned char (*fd_inb)(int port); |
@@ -212,13 +212,6 @@ static void sun_82077_fd_outb(unsigned char value, int port) | |||
212 | * underruns. If non-zero, doing_pdma encodes the direction of | 212 | * underruns. If non-zero, doing_pdma encodes the direction of |
213 | * the transfer for debugging. 1=read 2=write | 213 | * the transfer for debugging. 1=read 2=write |
214 | */ | 214 | */ |
215 | extern char *pdma_vaddr; | ||
216 | extern unsigned long pdma_size; | ||
217 | extern volatile int doing_pdma; | ||
218 | |||
219 | /* This is software state */ | ||
220 | extern char *pdma_base; | ||
221 | extern unsigned long pdma_areasize; | ||
222 | 215 | ||
223 | /* Common routines to all controller types on the Sparc. */ | 216 | /* Common routines to all controller types on the Sparc. */ |
224 | static inline void virtual_dma_init(void) | 217 | static inline void virtual_dma_init(void) |
diff --git a/arch/sparc/include/asm/irq_32.h b/arch/sparc/include/asm/irq_32.h index 2ae3acaeb1b3..9277e519468d 100644 --- a/arch/sparc/include/asm/irq_32.h +++ b/arch/sparc/include/asm/irq_32.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define irq_canonicalize(irq) (irq) | 17 | #define irq_canonicalize(irq) (irq) |
18 | 18 | ||
19 | extern void __init init_IRQ(void); | 19 | extern void __init init_IRQ(void); |
20 | void __init sun4d_init_sbi_irq(void); | ||
20 | 21 | ||
21 | #define NO_IRQ 0xffffffff | 22 | #define NO_IRQ 0xffffffff |
22 | 23 | ||
diff --git a/arch/sparc/include/asm/pgalloc_32.h b/arch/sparc/include/asm/pgalloc_32.h index 9b1c36de0f18..a3890da94428 100644 --- a/arch/sparc/include/asm/pgalloc_32.h +++ b/arch/sparc/include/asm/pgalloc_32.h | |||
@@ -14,6 +14,8 @@ struct page; | |||
14 | void *srmmu_get_nocache(int size, int align); | 14 | void *srmmu_get_nocache(int size, int align); |
15 | void srmmu_free_nocache(void *addr, int size); | 15 | void srmmu_free_nocache(void *addr, int size); |
16 | 16 | ||
17 | extern struct resource sparc_iomap; | ||
18 | |||
17 | #define check_pgt_cache() do { } while (0) | 19 | #define check_pgt_cache() do { } while (0) |
18 | 20 | ||
19 | pgd_t *get_pgd_fast(void); | 21 | pgd_t *get_pgd_fast(void); |
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index 502f632f6cc7..16629e7cb09e 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h | |||
@@ -27,6 +27,7 @@ struct page; | |||
27 | 27 | ||
28 | extern void load_mmu(void); | 28 | extern void load_mmu(void); |
29 | extern unsigned long calc_highpages(void); | 29 | extern unsigned long calc_highpages(void); |
30 | unsigned long __init bootmem_init(unsigned long *pages_avail); | ||
30 | 31 | ||
31 | #define pte_ERROR(e) __builtin_trap() | 32 | #define pte_ERROR(e) __builtin_trap() |
32 | #define pmd_ERROR(e) __builtin_trap() | 33 | #define pmd_ERROR(e) __builtin_trap() |
diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h index 5e35e0517318..fb54505e008e 100644 --- a/arch/sparc/include/asm/setup.h +++ b/arch/sparc/include/asm/setup.h | |||
@@ -4,8 +4,9 @@ | |||
4 | #ifndef _SPARC_SETUP_H | 4 | #ifndef _SPARC_SETUP_H |
5 | #define _SPARC_SETUP_H | 5 | #define _SPARC_SETUP_H |
6 | 6 | ||
7 | #include <uapi/asm/setup.h> | 7 | #include <linux/interrupt.h> |
8 | 8 | ||
9 | #include <uapi/asm/setup.h> | ||
9 | 10 | ||
10 | extern char reboot_command[]; | 11 | extern char reboot_command[]; |
11 | 12 | ||
@@ -22,6 +23,28 @@ static inline int con_is_present(void) | |||
22 | { | 23 | { |
23 | return serial_console ? 0 : 1; | 24 | return serial_console ? 0 : 1; |
24 | } | 25 | } |
26 | |||
27 | /* from irq_32.c */ | ||
28 | extern volatile unsigned char *fdc_status; | ||
29 | extern char *pdma_vaddr; | ||
30 | extern unsigned long pdma_size; | ||
31 | extern volatile int doing_pdma; | ||
32 | |||
33 | /* This is software state */ | ||
34 | extern char *pdma_base; | ||
35 | extern unsigned long pdma_areasize; | ||
36 | |||
37 | int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler); | ||
38 | |||
39 | /* setup_32.c */ | ||
40 | extern unsigned long cmdline_memory_size; | ||
41 | |||
42 | /* devices.c */ | ||
43 | void __init device_scan(void); | ||
44 | |||
45 | /* unaligned_32.c */ | ||
46 | unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int); | ||
47 | |||
25 | #endif | 48 | #endif |
26 | 49 | ||
27 | extern void sun_do_break(void); | 50 | extern void sun_do_break(void); |
diff --git a/arch/sparc/include/asm/timer_32.h b/arch/sparc/include/asm/timer_32.h index 72f40a546de3..93476f8d7fea 100644 --- a/arch/sparc/include/asm/timer_32.h +++ b/arch/sparc/include/asm/timer_32.h | |||
@@ -32,7 +32,7 @@ static inline unsigned int timer_value(unsigned int value) | |||
32 | return (value + 1) << TIMER_VALUE_SHIFT; | 32 | return (value + 1) << TIMER_VALUE_SHIFT; |
33 | } | 33 | } |
34 | 34 | ||
35 | extern __volatile__ unsigned int *master_l10_counter; | 35 | extern volatile unsigned int __iomem *master_l10_counter; |
36 | 36 | ||
37 | extern irqreturn_t notrace timer_interrupt(int dummy, void *dev_id); | 37 | extern irqreturn_t notrace timer_interrupt(int dummy, void *dev_id); |
38 | 38 | ||
diff --git a/arch/sparc/kernel/auxio_32.c b/arch/sparc/kernel/auxio_32.c index e20cc55fb768..c6fc1d451407 100644 --- a/arch/sparc/kernel/auxio_32.c +++ b/arch/sparc/kernel/auxio_32.c | |||
@@ -9,12 +9,15 @@ | |||
9 | #include <linux/of.h> | 9 | #include <linux/of.h> |
10 | #include <linux/of_device.h> | 10 | #include <linux/of_device.h> |
11 | #include <linux/export.h> | 11 | #include <linux/export.h> |
12 | |||
12 | #include <asm/oplib.h> | 13 | #include <asm/oplib.h> |
13 | #include <asm/io.h> | 14 | #include <asm/io.h> |
14 | #include <asm/auxio.h> | 15 | #include <asm/auxio.h> |
15 | #include <asm/string.h> /* memset(), Linux has no bzero() */ | 16 | #include <asm/string.h> /* memset(), Linux has no bzero() */ |
16 | #include <asm/cpu_type.h> | 17 | #include <asm/cpu_type.h> |
17 | 18 | ||
19 | #include "kernel.h" | ||
20 | |||
18 | /* Probe and map in the Auxiliary I/O register */ | 21 | /* Probe and map in the Auxiliary I/O register */ |
19 | 22 | ||
20 | /* auxio_register is not static because it is referenced | 23 | /* auxio_register is not static because it is referenced |
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 5c5125895db8..82a3a71c451e 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/cpudata.h> | 22 | #include <asm/cpudata.h> |
23 | 23 | ||
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | #include "entry.h" | ||
25 | 26 | ||
26 | DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; | 27 | DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; |
27 | EXPORT_PER_CPU_SYMBOL(__cpu_data); | 28 | EXPORT_PER_CPU_SYMBOL(__cpu_data); |
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c index 3d465e87f7e2..6f39916dc6e8 100644 --- a/arch/sparc/kernel/devices.c +++ b/arch/sparc/kernel/devices.c | |||
@@ -19,8 +19,9 @@ | |||
19 | #include <asm/smp.h> | 19 | #include <asm/smp.h> |
20 | #include <asm/cpudata.h> | 20 | #include <asm/cpudata.h> |
21 | #include <asm/cpu_type.h> | 21 | #include <asm/cpu_type.h> |
22 | #include <asm/setup.h> | ||
22 | 23 | ||
23 | extern void clock_stop_probe(void); /* tadpole.c */ | 24 | #include "kernel.h" |
24 | 25 | ||
25 | static char *cpu_mid_prop(void) | 26 | static char *cpu_mid_prop(void) |
26 | { | 27 | { |
@@ -131,11 +132,7 @@ void __init device_scan(void) | |||
131 | } | 132 | } |
132 | #endif /* !CONFIG_SMP */ | 133 | #endif /* !CONFIG_SMP */ |
133 | 134 | ||
134 | { | 135 | auxio_probe(); |
135 | extern void auxio_probe(void); | 136 | auxio_power_probe(); |
136 | extern void auxio_power_probe(void); | ||
137 | auxio_probe(); | ||
138 | auxio_power_probe(); | ||
139 | } | ||
140 | clock_stop_probe(); | 137 | clock_stop_probe(); |
141 | } | 138 | } |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index e7e215dfa866..7f08ec8a7c68 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -186,7 +186,7 @@ static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys, | |||
186 | 186 | ||
187 | if (name == NULL) name = "???"; | 187 | if (name == NULL) name = "???"; |
188 | 188 | ||
189 | if ((xres = xres_alloc()) != 0) { | 189 | if ((xres = xres_alloc()) != NULL) { |
190 | tack = xres->xname; | 190 | tack = xres->xname; |
191 | res = &xres->xres; | 191 | res = &xres->xres; |
192 | } else { | 192 | } else { |
@@ -400,7 +400,7 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
400 | BUG(); | 400 | BUG(); |
401 | } | 401 | } |
402 | 402 | ||
403 | struct dma_map_ops sbus_dma_ops = { | 403 | static struct dma_map_ops sbus_dma_ops = { |
404 | .alloc = sbus_alloc_coherent, | 404 | .alloc = sbus_alloc_coherent, |
405 | .free = sbus_free_coherent, | 405 | .free = sbus_free_coherent, |
406 | .map_page = sbus_map_page, | 406 | .map_page = sbus_map_page, |
@@ -681,7 +681,7 @@ static int sparc_io_proc_show(struct seq_file *m, void *v) | |||
681 | const char *nm; | 681 | const char *nm; |
682 | 682 | ||
683 | for (r = root->child; r != NULL; r = r->sibling) { | 683 | for (r = root->child; r != NULL; r = r->sibling) { |
684 | if ((nm = r->name) == 0) nm = "???"; | 684 | if ((nm = r->name) == NULL) nm = "???"; |
685 | seq_printf(m, "%016llx-%016llx: %s\n", | 685 | seq_printf(m, "%016llx-%016llx: %s\n", |
686 | (unsigned long long)r->start, | 686 | (unsigned long long)r->start, |
687 | (unsigned long long)r->end, nm); | 687 | (unsigned long long)r->end, nm); |
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h index b66b6aad1d6d..7c7540a62362 100644 --- a/arch/sparc/kernel/irq.h +++ b/arch/sparc/kernel/irq.h | |||
@@ -82,6 +82,15 @@ void handler_irq(unsigned int pil, struct pt_regs *regs); | |||
82 | 82 | ||
83 | unsigned long leon_get_irqmask(unsigned int irq); | 83 | unsigned long leon_get_irqmask(unsigned int irq); |
84 | 84 | ||
85 | /* irq_32.c */ | ||
86 | void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs); | ||
87 | |||
88 | /* sun4m_irq.c */ | ||
89 | void sun4m_nmi(struct pt_regs *regs); | ||
90 | |||
91 | /* sun4d_irq.c */ | ||
92 | void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs); | ||
93 | |||
85 | #ifdef CONFIG_SMP | 94 | #ifdef CONFIG_SMP |
86 | 95 | ||
87 | /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ | 96 | /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ |
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index c145f6fd123b..a979e99f8751 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/cpudata.h> | 19 | #include <asm/cpudata.h> |
20 | #include <asm/setup.h> | ||
20 | #include <asm/pcic.h> | 21 | #include <asm/pcic.h> |
21 | #include <asm/leon.h> | 22 | #include <asm/leon.h> |
22 | 23 | ||
diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h index a702d9ab019c..de9ac1aa25e8 100644 --- a/arch/sparc/kernel/kernel.h +++ b/arch/sparc/kernel/kernel.h | |||
@@ -51,6 +51,11 @@ extern void sun4m_clear_profile_irq(int cpu); | |||
51 | /* sun4m_smp.c */ | 51 | /* sun4m_smp.c */ |
52 | void sun4m_cpu_pre_starting(void *arg); | 52 | void sun4m_cpu_pre_starting(void *arg); |
53 | void sun4m_cpu_pre_online(void *arg); | 53 | void sun4m_cpu_pre_online(void *arg); |
54 | void __init smp4m_boot_cpus(void); | ||
55 | int smp4m_boot_one_cpu(int i, struct task_struct *idle); | ||
56 | void __init smp4m_smp_done(void); | ||
57 | void smp4m_cross_call_irq(void); | ||
58 | void smp4m_percpu_timer_interrupt(struct pt_regs *regs); | ||
54 | 59 | ||
55 | /* sun4d_irq.c */ | 60 | /* sun4d_irq.c */ |
56 | extern spinlock_t sun4d_imsk_lock; | 61 | extern spinlock_t sun4d_imsk_lock; |
@@ -67,10 +72,17 @@ extern void sun4d_free_irq(unsigned int irq, void *dev_id); | |||
67 | /* sun4d_smp.c */ | 72 | /* sun4d_smp.c */ |
68 | void sun4d_cpu_pre_starting(void *arg); | 73 | void sun4d_cpu_pre_starting(void *arg); |
69 | void sun4d_cpu_pre_online(void *arg); | 74 | void sun4d_cpu_pre_online(void *arg); |
75 | void __init smp4d_boot_cpus(void); | ||
76 | int smp4d_boot_one_cpu(int i, struct task_struct *idle); | ||
77 | void __init smp4d_smp_done(void); | ||
78 | void smp4d_cross_call_irq(void); | ||
79 | void smp4d_percpu_timer_interrupt(struct pt_regs *regs); | ||
70 | 80 | ||
71 | /* leon_smp.c */ | 81 | /* leon_smp.c */ |
72 | void leon_cpu_pre_starting(void *arg); | 82 | void leon_cpu_pre_starting(void *arg); |
73 | void leon_cpu_pre_online(void *arg); | 83 | void leon_cpu_pre_online(void *arg); |
84 | void leonsmp_ipi_interrupt(void); | ||
85 | void leon_cross_call_irq(void); | ||
74 | 86 | ||
75 | /* head_32.S */ | 87 | /* head_32.S */ |
76 | extern unsigned int t_nmi[]; | 88 | extern unsigned int t_nmi[]; |
@@ -95,6 +107,38 @@ extern void floppy_hardint(void); | |||
95 | extern unsigned long sun4m_cpu_startup; | 107 | extern unsigned long sun4m_cpu_startup; |
96 | extern unsigned long sun4d_cpu_startup; | 108 | extern unsigned long sun4d_cpu_startup; |
97 | 109 | ||
110 | /* process_32.c */ | ||
111 | asmlinkage int sparc_do_fork(unsigned long clone_flags, | ||
112 | unsigned long stack_start, | ||
113 | struct pt_regs *regs, | ||
114 | unsigned long stack_size); | ||
115 | |||
116 | /* signal_32.c */ | ||
117 | asmlinkage void do_sigreturn(struct pt_regs *regs); | ||
118 | asmlinkage void do_rt_sigreturn(struct pt_regs *regs); | ||
119 | void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, | ||
120 | unsigned long thread_info_flags); | ||
121 | asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, | ||
122 | struct sigstack __user *ossptr, | ||
123 | unsigned long sp); | ||
124 | |||
125 | /* ptrace_32.c */ | ||
126 | asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); | ||
127 | |||
128 | /* unaligned_32.c */ | ||
129 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); | ||
130 | asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); | ||
131 | |||
132 | /* windows.c */ | ||
133 | void try_to_clear_window_buffer(struct pt_regs *regs, int who); | ||
134 | |||
135 | /* tadpole.c */ | ||
136 | void __init clock_stop_probe(void); | ||
137 | |||
138 | /* auxio_32.c */ | ||
139 | void __init auxio_probe(void); | ||
140 | void __init auxio_power_probe(void); | ||
141 | |||
98 | #else /* CONFIG_SPARC32 */ | 142 | #else /* CONFIG_SPARC32 */ |
99 | #endif /* CONFIG_SPARC32 */ | 143 | #endif /* CONFIG_SPARC32 */ |
100 | #endif /* !(__SPARC_KERNEL_H) */ | 144 | #endif /* !(__SPARC_KERNEL_H) */ |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index b7c68976cbc7..d9397088893a 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -32,12 +32,12 @@ struct leon3_gptimer_regs_map *leon3_gptimer_regs; /* timer controller base addr | |||
32 | 32 | ||
33 | int leondebug_irq_disable; | 33 | int leondebug_irq_disable; |
34 | int leon_debug_irqout; | 34 | int leon_debug_irqout; |
35 | static int dummy_master_l10_counter; | 35 | static volatile unsigned int dummy_master_l10_counter; |
36 | unsigned long amba_system_id; | 36 | unsigned long amba_system_id; |
37 | static DEFINE_SPINLOCK(leon_irq_lock); | 37 | static DEFINE_SPINLOCK(leon_irq_lock); |
38 | 38 | ||
39 | static unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */ | ||
39 | unsigned long leon3_gptimer_irq; /* interrupt controller irq number */ | 40 | unsigned long leon3_gptimer_irq; /* interrupt controller irq number */ |
40 | unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */ | ||
41 | unsigned int sparc_leon_eirq; | 41 | unsigned int sparc_leon_eirq; |
42 | #define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu]) | 42 | #define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu]) |
43 | #define LEON_IACK (&leon3_irqctrl_regs->iclear) | 43 | #define LEON_IACK (&leon3_irqctrl_regs->iclear) |
@@ -65,7 +65,7 @@ static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | /* The extended IRQ controller has been found, this function registers it */ | 67 | /* The extended IRQ controller has been found, this function registers it */ |
68 | void leon_eirq_setup(unsigned int eirq) | 68 | static void leon_eirq_setup(unsigned int eirq) |
69 | { | 69 | { |
70 | unsigned long mask, oldmask; | 70 | unsigned long mask, oldmask; |
71 | unsigned int veirq; | 71 | unsigned int veirq; |
@@ -270,7 +270,7 @@ static u32 leon_cycles_offset(void) | |||
270 | #ifdef CONFIG_SMP | 270 | #ifdef CONFIG_SMP |
271 | 271 | ||
272 | /* smp clockevent irq */ | 272 | /* smp clockevent irq */ |
273 | irqreturn_t leon_percpu_timer_ce_interrupt(int irq, void *unused) | 273 | static irqreturn_t leon_percpu_timer_ce_interrupt(int irq, void *unused) |
274 | { | 274 | { |
275 | struct clock_event_device *ce; | 275 | struct clock_event_device *ce; |
276 | int cpu = smp_processor_id(); | 276 | int cpu = smp_processor_id(); |
@@ -313,7 +313,8 @@ void __init leon_init_timers(void) | |||
313 | 313 | ||
314 | leondebug_irq_disable = 0; | 314 | leondebug_irq_disable = 0; |
315 | leon_debug_irqout = 0; | 315 | leon_debug_irqout = 0; |
316 | master_l10_counter = (unsigned int *)&dummy_master_l10_counter; | 316 | master_l10_counter = |
317 | (unsigned int __iomem *)&dummy_master_l10_counter; | ||
317 | dummy_master_l10_counter = 0; | 318 | dummy_master_l10_counter = 0; |
318 | 319 | ||
319 | rootnp = of_find_node_by_path("/ambapp0"); | 320 | rootnp = of_find_node_by_path("/ambapp0"); |
diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c index 6df26e37f879..97cba4d11f66 100644 --- a/arch/sparc/kernel/leon_pci_grpci1.c +++ b/arch/sparc/kernel/leon_pci_grpci1.c | |||
@@ -80,7 +80,7 @@ struct grpci1_regs { | |||
80 | 80 | ||
81 | struct grpci1_priv { | 81 | struct grpci1_priv { |
82 | struct leon_pci_info info; /* must be on top of this structure */ | 82 | struct leon_pci_info info; /* must be on top of this structure */ |
83 | struct grpci1_regs *regs; /* GRPCI register map */ | 83 | struct grpci1_regs __iomem *regs; /* GRPCI register map */ |
84 | struct device *dev; | 84 | struct device *dev; |
85 | int pci_err_mask; /* STATUS register error mask */ | 85 | int pci_err_mask; /* STATUS register error mask */ |
86 | int irq; /* LEON irqctrl GRPCI IRQ */ | 86 | int irq; /* LEON irqctrl GRPCI IRQ */ |
@@ -101,7 +101,7 @@ static struct grpci1_priv *grpci1priv; | |||
101 | static int grpci1_cfg_w32(struct grpci1_priv *priv, unsigned int bus, | 101 | static int grpci1_cfg_w32(struct grpci1_priv *priv, unsigned int bus, |
102 | unsigned int devfn, int where, u32 val); | 102 | unsigned int devfn, int where, u32 val); |
103 | 103 | ||
104 | int grpci1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 104 | static int grpci1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
105 | { | 105 | { |
106 | struct grpci1_priv *priv = dev->bus->sysdata; | 106 | struct grpci1_priv *priv = dev->bus->sysdata; |
107 | int irq_group; | 107 | int irq_group; |
@@ -417,10 +417,10 @@ out: | |||
417 | * BAR1: peripheral DMA to host's memory (size at least 256MByte) | 417 | * BAR1: peripheral DMA to host's memory (size at least 256MByte) |
418 | * BAR2..BAR5: not implemented in hardware | 418 | * BAR2..BAR5: not implemented in hardware |
419 | */ | 419 | */ |
420 | void grpci1_hw_init(struct grpci1_priv *priv) | 420 | static void grpci1_hw_init(struct grpci1_priv *priv) |
421 | { | 421 | { |
422 | u32 ahbadr, bar_sz, data, pciadr; | 422 | u32 ahbadr, bar_sz, data, pciadr; |
423 | struct grpci1_regs *regs = priv->regs; | 423 | struct grpci1_regs __iomem *regs = priv->regs; |
424 | 424 | ||
425 | /* set 1:1 mapping between AHB -> PCI memory space */ | 425 | /* set 1:1 mapping between AHB -> PCI memory space */ |
426 | REGSTORE(regs->cfg_stat, priv->pci_area & 0xf0000000); | 426 | REGSTORE(regs->cfg_stat, priv->pci_area & 0xf0000000); |
@@ -509,7 +509,7 @@ static irqreturn_t grpci1_err_interrupt(int irq, void *arg) | |||
509 | 509 | ||
510 | static int grpci1_of_probe(struct platform_device *ofdev) | 510 | static int grpci1_of_probe(struct platform_device *ofdev) |
511 | { | 511 | { |
512 | struct grpci1_regs *regs; | 512 | struct grpci1_regs __iomem *regs; |
513 | struct grpci1_priv *priv; | 513 | struct grpci1_priv *priv; |
514 | int err, len; | 514 | int err, len; |
515 | const int *tmp; | 515 | const int *tmp; |
@@ -690,7 +690,7 @@ err3: | |||
690 | err2: | 690 | err2: |
691 | release_resource(&priv->info.mem_space); | 691 | release_resource(&priv->info.mem_space); |
692 | err1: | 692 | err1: |
693 | iounmap((void *)priv->pci_io_va); | 693 | iounmap((void __iomem *)priv->pci_io_va); |
694 | grpci1priv = NULL; | 694 | grpci1priv = NULL; |
695 | return err; | 695 | return err; |
696 | } | 696 | } |
diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c index 24d6a4446349..7ef024795b81 100644 --- a/arch/sparc/kernel/leon_pci_grpci2.c +++ b/arch/sparc/kernel/leon_pci_grpci2.c | |||
@@ -191,7 +191,7 @@ struct grpci2_cap_first { | |||
191 | 191 | ||
192 | struct grpci2_priv { | 192 | struct grpci2_priv { |
193 | struct leon_pci_info info; /* must be on top of this structure */ | 193 | struct leon_pci_info info; /* must be on top of this structure */ |
194 | struct grpci2_regs *regs; | 194 | struct grpci2_regs __iomem *regs; |
195 | char irq; | 195 | char irq; |
196 | char irq_mode; /* IRQ Mode from CAPSTS REG */ | 196 | char irq_mode; /* IRQ Mode from CAPSTS REG */ |
197 | char bt_enabled; | 197 | char bt_enabled; |
@@ -215,10 +215,10 @@ struct grpci2_priv { | |||
215 | struct grpci2_barcfg tgtbars[6]; | 215 | struct grpci2_barcfg tgtbars[6]; |
216 | }; | 216 | }; |
217 | 217 | ||
218 | DEFINE_SPINLOCK(grpci2_dev_lock); | 218 | static DEFINE_SPINLOCK(grpci2_dev_lock); |
219 | struct grpci2_priv *grpci2priv; | 219 | static struct grpci2_priv *grpci2priv; |
220 | 220 | ||
221 | int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 221 | static int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
222 | { | 222 | { |
223 | struct grpci2_priv *priv = dev->bus->sysdata; | 223 | struct grpci2_priv *priv = dev->bus->sysdata; |
224 | int irq_group; | 224 | int irq_group; |
@@ -561,10 +561,10 @@ out: | |||
561 | return virq; | 561 | return virq; |
562 | } | 562 | } |
563 | 563 | ||
564 | void grpci2_hw_init(struct grpci2_priv *priv) | 564 | static void grpci2_hw_init(struct grpci2_priv *priv) |
565 | { | 565 | { |
566 | u32 ahbadr, pciadr, bar_sz, capptr, io_map, data; | 566 | u32 ahbadr, pciadr, bar_sz, capptr, io_map, data; |
567 | struct grpci2_regs *regs = priv->regs; | 567 | struct grpci2_regs __iomem *regs = priv->regs; |
568 | int i; | 568 | int i; |
569 | struct grpci2_barcfg *barcfg = priv->tgtbars; | 569 | struct grpci2_barcfg *barcfg = priv->tgtbars; |
570 | 570 | ||
@@ -655,7 +655,7 @@ static irqreturn_t grpci2_jump_interrupt(int irq, void *arg) | |||
655 | static irqreturn_t grpci2_err_interrupt(int irq, void *arg) | 655 | static irqreturn_t grpci2_err_interrupt(int irq, void *arg) |
656 | { | 656 | { |
657 | struct grpci2_priv *priv = arg; | 657 | struct grpci2_priv *priv = arg; |
658 | struct grpci2_regs *regs = priv->regs; | 658 | struct grpci2_regs __iomem *regs = priv->regs; |
659 | unsigned int status; | 659 | unsigned int status; |
660 | 660 | ||
661 | status = REGLOAD(regs->sts_cap); | 661 | status = REGLOAD(regs->sts_cap); |
@@ -682,7 +682,7 @@ static irqreturn_t grpci2_err_interrupt(int irq, void *arg) | |||
682 | 682 | ||
683 | static int grpci2_of_probe(struct platform_device *ofdev) | 683 | static int grpci2_of_probe(struct platform_device *ofdev) |
684 | { | 684 | { |
685 | struct grpci2_regs *regs; | 685 | struct grpci2_regs __iomem *regs; |
686 | struct grpci2_priv *priv; | 686 | struct grpci2_priv *priv; |
687 | int err, i, len; | 687 | int err, i, len; |
688 | const int *tmp; | 688 | const int *tmp; |
@@ -878,7 +878,7 @@ err4: | |||
878 | release_resource(&priv->info.mem_space); | 878 | release_resource(&priv->info.mem_space); |
879 | err3: | 879 | err3: |
880 | err = -ENOMEM; | 880 | err = -ENOMEM; |
881 | iounmap((void *)priv->pci_io_va); | 881 | iounmap((void __iomem *)priv->pci_io_va); |
882 | err2: | 882 | err2: |
883 | kfree(priv); | 883 | kfree(priv); |
884 | err1: | 884 | err1: |
diff --git a/arch/sparc/kernel/leon_pmc.c b/arch/sparc/kernel/leon_pmc.c index b0b3967a2dd2..ddcf950282ed 100644 --- a/arch/sparc/kernel/leon_pmc.c +++ b/arch/sparc/kernel/leon_pmc.c | |||
@@ -12,14 +12,14 @@ | |||
12 | #include <asm/processor.h> | 12 | #include <asm/processor.h> |
13 | 13 | ||
14 | /* List of Systems that need fixup instructions around power-down instruction */ | 14 | /* List of Systems that need fixup instructions around power-down instruction */ |
15 | unsigned int pmc_leon_fixup_ids[] = { | 15 | static unsigned int pmc_leon_fixup_ids[] = { |
16 | AEROFLEX_UT699, | 16 | AEROFLEX_UT699, |
17 | GAISLER_GR712RC, | 17 | GAISLER_GR712RC, |
18 | LEON4_NEXTREME1, | 18 | LEON4_NEXTREME1, |
19 | 0 | 19 | 0 |
20 | }; | 20 | }; |
21 | 21 | ||
22 | int pmc_leon_need_fixup(void) | 22 | static int pmc_leon_need_fixup(void) |
23 | { | 23 | { |
24 | unsigned int systemid = amba_system_id >> 16; | 24 | unsigned int systemid = amba_system_id >> 16; |
25 | unsigned int *id; | 25 | unsigned int *id; |
@@ -38,7 +38,7 @@ int pmc_leon_need_fixup(void) | |||
38 | * CPU idle callback function for systems that need some extra handling | 38 | * CPU idle callback function for systems that need some extra handling |
39 | * See .../arch/sparc/kernel/process.c | 39 | * See .../arch/sparc/kernel/process.c |
40 | */ | 40 | */ |
41 | void pmc_leon_idle_fixup(void) | 41 | static void pmc_leon_idle_fixup(void) |
42 | { | 42 | { |
43 | /* Prepare an address to a non-cachable region. APB is always | 43 | /* Prepare an address to a non-cachable region. APB is always |
44 | * none-cachable. One instruction is executed after the Sleep | 44 | * none-cachable. One instruction is executed after the Sleep |
@@ -62,7 +62,7 @@ void pmc_leon_idle_fixup(void) | |||
62 | * CPU idle callback function | 62 | * CPU idle callback function |
63 | * See .../arch/sparc/kernel/process.c | 63 | * See .../arch/sparc/kernel/process.c |
64 | */ | 64 | */ |
65 | void pmc_leon_idle(void) | 65 | static void pmc_leon_idle(void) |
66 | { | 66 | { |
67 | /* Interrupts need to be enabled to not hang the CPU */ | 67 | /* Interrupts need to be enabled to not hang the CPU */ |
68 | local_irq_enable(); | 68 | local_irq_enable(); |
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 6edf955f987c..018ef11f57df 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c | |||
@@ -130,7 +130,7 @@ void leon_configure_cache_smp(void) | |||
130 | local_ops->tlb_all(); | 130 | local_ops->tlb_all(); |
131 | } | 131 | } |
132 | 132 | ||
133 | void leon_smp_setbroadcast(unsigned int mask) | 133 | static void leon_smp_setbroadcast(unsigned int mask) |
134 | { | 134 | { |
135 | int broadcast = | 135 | int broadcast = |
136 | ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >> | 136 | ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >> |
@@ -148,13 +148,6 @@ void leon_smp_setbroadcast(unsigned int mask) | |||
148 | LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask); | 148 | LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask); |
149 | } | 149 | } |
150 | 150 | ||
151 | unsigned int leon_smp_getbroadcast(void) | ||
152 | { | ||
153 | unsigned int mask; | ||
154 | mask = LEON_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpbroadcast)); | ||
155 | return mask; | ||
156 | } | ||
157 | |||
158 | int leon_smp_nrcpus(void) | 151 | int leon_smp_nrcpus(void) |
159 | { | 152 | { |
160 | int nrcpu = | 153 | int nrcpu = |
@@ -266,10 +259,6 @@ void __init leon_smp_done(void) | |||
266 | 259 | ||
267 | } | 260 | } |
268 | 261 | ||
269 | void leon_irq_rotate(int cpu) | ||
270 | { | ||
271 | } | ||
272 | |||
273 | struct leon_ipi_work { | 262 | struct leon_ipi_work { |
274 | int single; | 263 | int single; |
275 | int msk; | 264 | int msk; |
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c index 3241f56331c2..de0ee3971f00 100644 --- a/arch/sparc/kernel/of_device_common.c +++ b/arch/sparc/kernel/of_device_common.c | |||
@@ -5,8 +5,10 @@ | |||
5 | #include <linux/mod_devicetable.h> | 5 | #include <linux/mod_devicetable.h> |
6 | #include <linux/errno.h> | 6 | #include <linux/errno.h> |
7 | #include <linux/irq.h> | 7 | #include <linux/irq.h> |
8 | #include <linux/of_device.h> | ||
9 | #include <linux/of_platform.h> | 8 | #include <linux/of_platform.h> |
9 | #include <linux/of_address.h> | ||
10 | #include <linux/of_device.h> | ||
11 | #include <linux/of_irq.h> | ||
10 | 12 | ||
11 | #include "of_device_common.h" | 13 | #include "of_device_common.h" |
12 | 14 | ||
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index 510baec1b69b..61f810b0a9d9 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <stdarg.h> | 11 | #include <stdarg.h> |
12 | 12 | ||
13 | #include <linux/elfcore.h> | ||
13 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
@@ -23,6 +24,7 @@ | |||
23 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
24 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
25 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/cpu.h> | ||
26 | 28 | ||
27 | #include <asm/auxio.h> | 29 | #include <asm/auxio.h> |
28 | #include <asm/oplib.h> | 30 | #include <asm/oplib.h> |
@@ -38,6 +40,8 @@ | |||
38 | #include <asm/unistd.h> | 40 | #include <asm/unistd.h> |
39 | #include <asm/setup.h> | 41 | #include <asm/setup.h> |
40 | 42 | ||
43 | #include "kernel.h" | ||
44 | |||
41 | /* | 45 | /* |
42 | * Power management idle function | 46 | * Power management idle function |
43 | * Set in pm platform drivers (apc.c and pmc.c) | 47 | * Set in pm platform drivers (apc.c and pmc.c) |
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c index 896ba7c5cd8e..a331fdc11a2c 100644 --- a/arch/sparc/kernel/ptrace_32.c +++ b/arch/sparc/kernel/ptrace_32.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
27 | #include <asm/cacheflush.h> | 27 | #include <asm/cacheflush.h> |
28 | 28 | ||
29 | #include "kernel.h" | ||
30 | |||
29 | /* #define ALLOW_INIT_TRACING */ | 31 | /* #define ALLOW_INIT_TRACING */ |
30 | 32 | ||
31 | /* | 33 | /* |
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 1434526970a6..baef495c06bd 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c | |||
@@ -267,7 +267,7 @@ static __init void leon_patch(void) | |||
267 | } | 267 | } |
268 | 268 | ||
269 | struct tt_entry *sparc_ttable; | 269 | struct tt_entry *sparc_ttable; |
270 | struct pt_regs fake_swapper_regs; | 270 | static struct pt_regs fake_swapper_regs; |
271 | 271 | ||
272 | /* Called from head_32.S - before we have setup anything | 272 | /* Called from head_32.S - before we have setup anything |
273 | * in the kernel. Be very careful with what you do here. | 273 | * in the kernel. Be very careful with what you do here. |
@@ -365,7 +365,7 @@ void __init setup_arch(char **cmdline_p) | |||
365 | 365 | ||
366 | prom_setsync(prom_sync_me); | 366 | prom_setsync(prom_sync_me); |
367 | 367 | ||
368 | if((boot_flags&BOOTME_DEBUG) && (linux_dbvec!=0) && | 368 | if((boot_flags & BOOTME_DEBUG) && (linux_dbvec != NULL) && |
369 | ((*(short *)linux_dbvec) != -1)) { | 369 | ((*(short *)linux_dbvec) != -1)) { |
370 | printk("Booted under KADB. Syncing trap table.\n"); | 370 | printk("Booted under KADB. Syncing trap table.\n"); |
371 | (*(linux_dbvec->teach_debugger))(); | 371 | (*(linux_dbvec->teach_debugger))(); |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 7d5d8e1f8415..9ee72fc8e0e4 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/switch_to.h> | 28 | #include <asm/switch_to.h> |
29 | 29 | ||
30 | #include "sigutil.h" | 30 | #include "sigutil.h" |
31 | #include "kernel.h" | ||
31 | 32 | ||
32 | extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | 33 | extern void fpsave(unsigned long *fpregs, unsigned long *fsr, |
33 | void *fpqueue, unsigned long *fpqdepth); | 34 | void *fpqueue, unsigned long *fpqdepth); |
@@ -341,7 +342,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs, | |||
341 | err |= __put_user(0, &sf->extra_size); | 342 | err |= __put_user(0, &sf->extra_size); |
342 | 343 | ||
343 | if (psr & PSR_EF) { | 344 | if (psr & PSR_EF) { |
344 | __siginfo_fpu_t *fp = tail; | 345 | __siginfo_fpu_t __user *fp = tail; |
345 | tail += sizeof(*fp); | 346 | tail += sizeof(*fp); |
346 | err |= save_fpu_state(regs, fp); | 347 | err |= save_fpu_state(regs, fp); |
347 | err |= __put_user(fp, &sf->fpu_save); | 348 | err |= __put_user(fp, &sf->fpu_save); |
@@ -349,7 +350,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs, | |||
349 | err |= __put_user(0, &sf->fpu_save); | 350 | err |= __put_user(0, &sf->fpu_save); |
350 | } | 351 | } |
351 | if (wsaved) { | 352 | if (wsaved) { |
352 | __siginfo_rwin_t *rwp = tail; | 353 | __siginfo_rwin_t __user *rwp = tail; |
353 | tail += sizeof(*rwp); | 354 | tail += sizeof(*rwp); |
354 | err |= save_rwin_state(wsaved, rwp); | 355 | err |= save_rwin_state(wsaved, rwp); |
355 | err |= __put_user(rwp, &sf->rwin_save); | 356 | err |= __put_user(rwp, &sf->rwin_save); |
@@ -517,9 +518,9 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, | |||
517 | } | 518 | } |
518 | } | 519 | } |
519 | 520 | ||
520 | asmlinkage int | 521 | asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, |
521 | do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr, | 522 | struct sigstack __user *ossptr, |
522 | unsigned long sp) | 523 | unsigned long sp) |
523 | { | 524 | { |
524 | int ret = -EFAULT; | 525 | int ret = -EFAULT; |
525 | 526 | ||
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c index a102bfba6ea8..9d3297d8d730 100644 --- a/arch/sparc/kernel/smp_32.c +++ b/arch/sparc/kernel/smp_32.c | |||
@@ -75,8 +75,6 @@ void smp_store_cpu_info(int id) | |||
75 | 75 | ||
76 | void __init smp_cpus_done(unsigned int max_cpus) | 76 | void __init smp_cpus_done(unsigned int max_cpus) |
77 | { | 77 | { |
78 | extern void smp4m_smp_done(void); | ||
79 | extern void smp4d_smp_done(void); | ||
80 | unsigned long bogosum = 0; | 78 | unsigned long bogosum = 0; |
81 | int cpu, num = 0; | 79 | int cpu, num = 0; |
82 | 80 | ||
@@ -183,8 +181,6 @@ int setup_profiling_timer(unsigned int multiplier) | |||
183 | 181 | ||
184 | void __init smp_prepare_cpus(unsigned int max_cpus) | 182 | void __init smp_prepare_cpus(unsigned int max_cpus) |
185 | { | 183 | { |
186 | extern void __init smp4m_boot_cpus(void); | ||
187 | extern void __init smp4d_boot_cpus(void); | ||
188 | int i, cpuid, extra; | 184 | int i, cpuid, extra; |
189 | 185 | ||
190 | printk("Entering SMP Mode...\n"); | 186 | printk("Entering SMP Mode...\n"); |
@@ -261,8 +257,6 @@ void __init smp_prepare_boot_cpu(void) | |||
261 | 257 | ||
262 | int __cpu_up(unsigned int cpu, struct task_struct *tidle) | 258 | int __cpu_up(unsigned int cpu, struct task_struct *tidle) |
263 | { | 259 | { |
264 | extern int smp4m_boot_one_cpu(int, struct task_struct *); | ||
265 | extern int smp4d_boot_one_cpu(int, struct task_struct *); | ||
266 | int ret=0; | 260 | int ret=0; |
267 | 261 | ||
268 | switch(sparc_cpu_model) { | 262 | switch(sparc_cpu_model) { |
@@ -297,7 +291,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) | |||
297 | return ret; | 291 | return ret; |
298 | } | 292 | } |
299 | 293 | ||
300 | void arch_cpu_pre_starting(void *arg) | 294 | static void arch_cpu_pre_starting(void *arg) |
301 | { | 295 | { |
302 | local_ops->cache_all(); | 296 | local_ops->cache_all(); |
303 | local_ops->tlb_all(); | 297 | local_ops->tlb_all(); |
@@ -317,7 +311,7 @@ void arch_cpu_pre_starting(void *arg) | |||
317 | } | 311 | } |
318 | } | 312 | } |
319 | 313 | ||
320 | void arch_cpu_pre_online(void *arg) | 314 | static void arch_cpu_pre_online(void *arg) |
321 | { | 315 | { |
322 | unsigned int cpuid = hard_smp_processor_id(); | 316 | unsigned int cpuid = hard_smp_processor_id(); |
323 | 317 | ||
@@ -344,7 +338,7 @@ void arch_cpu_pre_online(void *arg) | |||
344 | } | 338 | } |
345 | } | 339 | } |
346 | 340 | ||
347 | void sparc_start_secondary(void *arg) | 341 | static void sparc_start_secondary(void *arg) |
348 | { | 342 | { |
349 | unsigned int cpu; | 343 | unsigned int cpu; |
350 | 344 | ||
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index f8933be3ca8b..a1bb2675b280 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -143,7 +143,7 @@ static void sun4d_sbus_handler_irq(int sbusl) | |||
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | void sun4d_handler_irq(int pil, struct pt_regs *regs) | 146 | void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs) |
147 | { | 147 | { |
148 | struct pt_regs *old_regs; | 148 | struct pt_regs *old_regs; |
149 | /* SBUS IRQ level (1 - 7) */ | 149 | /* SBUS IRQ level (1 - 7) */ |
@@ -236,7 +236,7 @@ static void sun4d_shutdown_irq(struct irq_data *data) | |||
236 | irq_unlink(data->irq); | 236 | irq_unlink(data->irq); |
237 | } | 237 | } |
238 | 238 | ||
239 | struct irq_chip sun4d_irq = { | 239 | static struct irq_chip sun4d_irq = { |
240 | .name = "sun4d", | 240 | .name = "sun4d", |
241 | .irq_startup = sun4d_startup_irq, | 241 | .irq_startup = sun4d_startup_irq, |
242 | .irq_shutdown = sun4d_shutdown_irq, | 242 | .irq_shutdown = sun4d_shutdown_irq, |
@@ -285,9 +285,9 @@ static void __init sun4d_load_profile_irqs(void) | |||
285 | } | 285 | } |
286 | } | 286 | } |
287 | 287 | ||
288 | unsigned int _sun4d_build_device_irq(unsigned int real_irq, | 288 | static unsigned int _sun4d_build_device_irq(unsigned int real_irq, |
289 | unsigned int pil, | 289 | unsigned int pil, |
290 | unsigned int board) | 290 | unsigned int board) |
291 | { | 291 | { |
292 | struct sun4d_handler_data *handler_data; | 292 | struct sun4d_handler_data *handler_data; |
293 | unsigned int irq; | 293 | unsigned int irq; |
@@ -320,8 +320,8 @@ err_out: | |||
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | unsigned int sun4d_build_device_irq(struct platform_device *op, | 323 | static unsigned int sun4d_build_device_irq(struct platform_device *op, |
324 | unsigned int real_irq) | 324 | unsigned int real_irq) |
325 | { | 325 | { |
326 | struct device_node *dp = op->dev.of_node; | 326 | struct device_node *dp = op->dev.of_node; |
327 | struct device_node *board_parent, *bus = dp->parent; | 327 | struct device_node *board_parent, *bus = dp->parent; |
@@ -383,7 +383,8 @@ err_out: | |||
383 | return irq; | 383 | return irq; |
384 | } | 384 | } |
385 | 385 | ||
386 | unsigned int sun4d_build_timer_irq(unsigned int board, unsigned int real_irq) | 386 | static unsigned int sun4d_build_timer_irq(unsigned int board, |
387 | unsigned int real_irq) | ||
387 | { | 388 | { |
388 | return _sun4d_build_device_irq(real_irq, real_irq, board); | 389 | return _sun4d_build_device_irq(real_irq, real_irq, board); |
389 | } | 390 | } |
diff --git a/arch/sparc/kernel/tadpole.c b/arch/sparc/kernel/tadpole.c index 9aba8bd5a78b..4bbfe4e2676d 100644 --- a/arch/sparc/kernel/tadpole.c +++ b/arch/sparc/kernel/tadpole.c | |||
@@ -12,13 +12,17 @@ | |||
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | 14 | ||
15 | #include "kernel.h" | ||
16 | |||
15 | #define MACIO_SCSI_CSR_ADDR 0x78400000 | 17 | #define MACIO_SCSI_CSR_ADDR 0x78400000 |
16 | #define MACIO_EN_DMA 0x00000200 | 18 | #define MACIO_EN_DMA 0x00000200 |
17 | #define CLOCK_INIT_DONE 1 | 19 | #define CLOCK_INIT_DONE 1 |
18 | 20 | ||
19 | static int clk_state; | 21 | static int clk_state; |
20 | static volatile unsigned char *clk_ctrl; | 22 | static volatile unsigned char *clk_ctrl; |
21 | void (*cpu_pwr_save)(void); | 23 | |
24 | /* TODO - cpu_pwr_save is only assigned - cleanup potential. */ | ||
25 | static void (*cpu_pwr_save)(void); | ||
22 | 26 | ||
23 | static inline unsigned int ldphys(unsigned int addr) | 27 | static inline unsigned int ldphys(unsigned int addr) |
24 | { | 28 | { |
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index c4c27b0f9063..772b37986a9c 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c | |||
@@ -83,7 +83,7 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
83 | 83 | ||
84 | EXPORT_SYMBOL(profile_pc); | 84 | EXPORT_SYMBOL(profile_pc); |
85 | 85 | ||
86 | __volatile__ unsigned int *master_l10_counter; | 86 | volatile unsigned int __iomem *master_l10_counter; |
87 | 87 | ||
88 | int update_persistent_clock(struct timespec now) | 88 | int update_persistent_clock(struct timespec now) |
89 | { | 89 | { |
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c index 662982946a89..a655e5bf92a7 100644 --- a/arch/sparc/kernel/traps_32.c +++ b/arch/sparc/kernel/traps_32.c | |||
@@ -44,7 +44,7 @@ static void instruction_dump(unsigned long *pc) | |||
44 | #define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t") | 44 | #define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t") |
45 | #define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t") | 45 | #define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t") |
46 | 46 | ||
47 | void die_if_kernel(char *str, struct pt_regs *regs) | 47 | void __noreturn die_if_kernel(char *str, struct pt_regs *regs) |
48 | { | 48 | { |
49 | static int die_counter; | 49 | static int die_counter; |
50 | int count = 0; | 50 | int count = 0; |
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c index c0ec89786193..c5c61b3c6b56 100644 --- a/arch/sparc/kernel/unaligned_32.c +++ b/arch/sparc/kernel/unaligned_32.c | |||
@@ -16,6 +16,10 @@ | |||
16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | #include <linux/perf_event.h> | 17 | #include <linux/perf_event.h> |
18 | 18 | ||
19 | #include <asm/setup.h> | ||
20 | |||
21 | #include "kernel.h" | ||
22 | |||
19 | enum direction { | 23 | enum direction { |
20 | load, /* ld, ldd, ldh, ldsh */ | 24 | load, /* ld, ldd, ldh, ldsh */ |
21 | store, /* st, std, sth, stsh */ | 25 | store, /* st, std, sth, stsh */ |
diff --git a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c index 3107381e576d..87bab0a3857a 100644 --- a/arch/sparc/kernel/windows.c +++ b/arch/sparc/kernel/windows.c | |||
@@ -10,8 +10,11 @@ | |||
10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
12 | 12 | ||
13 | #include <asm/cacheflush.h> | ||
13 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
14 | 15 | ||
16 | #include "kernel.h" | ||
17 | |||
15 | /* Do save's until all user register windows are out of the cpu. */ | 18 | /* Do save's until all user register windows are out of the cpu. */ |
16 | void flush_user_windows(void) | 19 | void flush_user_windows(void) |
17 | { | 20 | { |
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index 59dbd4645725..908e8c17c902 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c | |||
@@ -26,14 +26,14 @@ | |||
26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
27 | #include <asm/openprom.h> | 27 | #include <asm/openprom.h> |
28 | #include <asm/oplib.h> | 28 | #include <asm/oplib.h> |
29 | #include <asm/setup.h> | ||
29 | #include <asm/smp.h> | 30 | #include <asm/smp.h> |
30 | #include <asm/traps.h> | 31 | #include <asm/traps.h> |
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | 33 | ||
33 | int show_unhandled_signals = 1; | 34 | #include "mm_32.h" |
34 | 35 | ||
35 | static void unhandled_fault(unsigned long, struct task_struct *, | 36 | int show_unhandled_signals = 1; |
36 | struct pt_regs *) __attribute__ ((noreturn)); | ||
37 | 37 | ||
38 | static void __noreturn unhandled_fault(unsigned long address, | 38 | static void __noreturn unhandled_fault(unsigned long address, |
39 | struct task_struct *tsk, | 39 | struct task_struct *tsk, |
@@ -141,9 +141,6 @@ static void __do_fault_siginfo(int code, int sig, struct pt_regs *regs, | |||
141 | force_sig_info (sig, &info, current); | 141 | force_sig_info (sig, &info, current); |
142 | } | 142 | } |
143 | 143 | ||
144 | extern unsigned long safe_compute_effective_address(struct pt_regs *, | ||
145 | unsigned int); | ||
146 | |||
147 | static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) | 144 | static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) |
148 | { | 145 | { |
149 | unsigned int insn; | 146 | unsigned int insn; |
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index db6987082805..eb8287155279 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c | |||
@@ -31,10 +31,13 @@ | |||
31 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
32 | #include <asm/vaddrs.h> | 32 | #include <asm/vaddrs.h> |
33 | #include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */ | 33 | #include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */ |
34 | #include <asm/setup.h> | ||
34 | #include <asm/tlb.h> | 35 | #include <asm/tlb.h> |
35 | #include <asm/prom.h> | 36 | #include <asm/prom.h> |
36 | #include <asm/leon.h> | 37 | #include <asm/leon.h> |
37 | 38 | ||
39 | #include "mm_32.h" | ||
40 | |||
38 | unsigned long *sparc_valid_addr_bitmap; | 41 | unsigned long *sparc_valid_addr_bitmap; |
39 | EXPORT_SYMBOL(sparc_valid_addr_bitmap); | 42 | EXPORT_SYMBOL(sparc_valid_addr_bitmap); |
40 | 43 | ||
@@ -63,7 +66,6 @@ void show_mem(unsigned int filter) | |||
63 | } | 66 | } |
64 | 67 | ||
65 | 68 | ||
66 | extern unsigned long cmdline_memory_size; | ||
67 | unsigned long last_valid_pfn; | 69 | unsigned long last_valid_pfn; |
68 | 70 | ||
69 | unsigned long calc_highpages(void) | 71 | unsigned long calc_highpages(void) |
@@ -246,9 +248,6 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) | |||
246 | * init routine based upon the Sun model type on the Sparc. | 248 | * init routine based upon the Sun model type on the Sparc. |
247 | * | 249 | * |
248 | */ | 250 | */ |
249 | extern void srmmu_paging_init(void); | ||
250 | extern void device_scan(void); | ||
251 | |||
252 | void __init paging_init(void) | 251 | void __init paging_init(void) |
253 | { | 252 | { |
254 | srmmu_paging_init(); | 253 | srmmu_paging_init(); |
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index 28f96f27c768..35384cb60b21 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <asm/iommu.h> | 27 | #include <asm/iommu.h> |
28 | #include <asm/dma.h> | 28 | #include <asm/dma.h> |
29 | 29 | ||
30 | #include "mm_32.h" | ||
31 | |||
30 | /* | 32 | /* |
31 | * This can be sized dynamically, but we will do this | 33 | * This can be sized dynamically, but we will do this |
32 | * only when we have a guidance about actual I/O pressures. | 34 | * only when we have a guidance about actual I/O pressures. |
@@ -37,9 +39,6 @@ | |||
37 | #define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */ | 39 | #define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */ |
38 | #define IOMMU_ORDER 6 /* 4096 * (1<<6) */ | 40 | #define IOMMU_ORDER 6 /* 4096 * (1<<6) */ |
39 | 41 | ||
40 | /* srmmu.c */ | ||
41 | extern int viking_mxcc_present; | ||
42 | extern int flush_page_for_dma_global; | ||
43 | static int viking_flush; | 42 | static int viking_flush; |
44 | /* viking.S */ | 43 | /* viking.S */ |
45 | extern void viking_flush_page(unsigned long page); | 44 | extern void viking_flush_page(unsigned long page); |
diff --git a/arch/sparc/mm/leon_mm.c b/arch/sparc/mm/leon_mm.c index 5bed085a2c17..3b17b6f7895a 100644 --- a/arch/sparc/mm/leon_mm.c +++ b/arch/sparc/mm/leon_mm.c | |||
@@ -15,10 +15,10 @@ | |||
15 | #include <asm/leon.h> | 15 | #include <asm/leon.h> |
16 | #include <asm/tlbflush.h> | 16 | #include <asm/tlbflush.h> |
17 | 17 | ||
18 | #include "srmmu.h" | 18 | #include "mm_32.h" |
19 | 19 | ||
20 | int leon_flush_during_switch = 1; | 20 | int leon_flush_during_switch = 1; |
21 | int srmmu_swprobe_trace; | 21 | static int srmmu_swprobe_trace; |
22 | 22 | ||
23 | static inline unsigned long leon_get_ctable_ptr(void) | 23 | static inline unsigned long leon_get_ctable_ptr(void) |
24 | { | 24 | { |
diff --git a/arch/sparc/mm/mm_32.h b/arch/sparc/mm/mm_32.h new file mode 100644 index 000000000000..a6c27ca9a721 --- /dev/null +++ b/arch/sparc/mm/mm_32.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* fault_32.c - visible as they are called from assembler */ | ||
2 | asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, | ||
3 | unsigned long address); | ||
4 | asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, | ||
5 | unsigned long address); | ||
6 | |||
7 | void window_overflow_fault(void); | ||
8 | void window_underflow_fault(unsigned long sp); | ||
9 | void window_ret_fault(struct pt_regs *regs); | ||
10 | |||
11 | /* srmmu.c */ | ||
12 | extern char *srmmu_name; | ||
13 | extern int viking_mxcc_present; | ||
14 | extern int flush_page_for_dma_global; | ||
15 | |||
16 | extern void (*poke_srmmu)(void); | ||
17 | |||
18 | void __init srmmu_paging_init(void); | ||
19 | |||
20 | /* iommu.c */ | ||
21 | void ld_mmu_iommu(void); | ||
22 | |||
23 | /* io-unit.c */ | ||
24 | void ld_mmu_iounit(void); | ||
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index cfbe53c17b0d..be65f035d18a 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #include <asm/mxcc.h> | 49 | #include <asm/mxcc.h> |
50 | #include <asm/ross.h> | 50 | #include <asm/ross.h> |
51 | 51 | ||
52 | #include "srmmu.h" | 52 | #include "mm_32.h" |
53 | 53 | ||
54 | enum mbus_module srmmu_modtype; | 54 | enum mbus_module srmmu_modtype; |
55 | static unsigned int hwbug_bitmask; | 55 | static unsigned int hwbug_bitmask; |
@@ -100,7 +100,6 @@ static unsigned long srmmu_nocache_end; | |||
100 | #define SRMMU_NOCACHE_ALIGN_MAX (sizeof(ctxd_t)*SRMMU_MAX_CONTEXTS) | 100 | #define SRMMU_NOCACHE_ALIGN_MAX (sizeof(ctxd_t)*SRMMU_MAX_CONTEXTS) |
101 | 101 | ||
102 | void *srmmu_nocache_pool; | 102 | void *srmmu_nocache_pool; |
103 | void *srmmu_nocache_bitmap; | ||
104 | static struct bit_map srmmu_nocache_map; | 103 | static struct bit_map srmmu_nocache_map; |
105 | 104 | ||
106 | static inline int srmmu_pmd_none(pmd_t pmd) | 105 | static inline int srmmu_pmd_none(pmd_t pmd) |
@@ -173,7 +172,7 @@ static void *__srmmu_get_nocache(int size, int align) | |||
173 | printk(KERN_ERR "srmmu: out of nocache %d: %d/%d\n", | 172 | printk(KERN_ERR "srmmu: out of nocache %d: %d/%d\n", |
174 | size, (int) srmmu_nocache_size, | 173 | size, (int) srmmu_nocache_size, |
175 | srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT); | 174 | srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT); |
176 | return 0; | 175 | return NULL; |
177 | } | 176 | } |
178 | 177 | ||
179 | addr = SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT); | 178 | addr = SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT); |
@@ -269,6 +268,7 @@ static void __init srmmu_nocache_calcsize(void) | |||
269 | 268 | ||
270 | static void __init srmmu_nocache_init(void) | 269 | static void __init srmmu_nocache_init(void) |
271 | { | 270 | { |
271 | void *srmmu_nocache_bitmap; | ||
272 | unsigned int bitmap_bits; | 272 | unsigned int bitmap_bits; |
273 | pgd_t *pgd; | 273 | pgd_t *pgd; |
274 | pmd_t *pmd; | 274 | pmd_t *pmd; |
@@ -728,7 +728,7 @@ static inline unsigned long srmmu_probe(unsigned long vaddr) | |||
728 | "=r" (retval) : | 728 | "=r" (retval) : |
729 | "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); | 729 | "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); |
730 | } else { | 730 | } else { |
731 | retval = leon_swprobe(vaddr, 0); | 731 | retval = leon_swprobe(vaddr, NULL); |
732 | } | 732 | } |
733 | return retval; | 733 | return retval; |
734 | } | 734 | } |
@@ -865,8 +865,6 @@ static void __init map_kernel(void) | |||
865 | 865 | ||
866 | void (*poke_srmmu)(void) = NULL; | 866 | void (*poke_srmmu)(void) = NULL; |
867 | 867 | ||
868 | extern unsigned long bootmem_init(unsigned long *pages_avail); | ||
869 | |||
870 | void __init srmmu_paging_init(void) | 868 | void __init srmmu_paging_init(void) |
871 | { | 869 | { |
872 | int i; | 870 | int i; |
@@ -1771,9 +1769,6 @@ static struct sparc32_cachetlb_ops smp_cachetlb_ops = { | |||
1771 | /* Load up routines and constants for sun4m and sun4d mmu */ | 1769 | /* Load up routines and constants for sun4m and sun4d mmu */ |
1772 | void __init load_mmu(void) | 1770 | void __init load_mmu(void) |
1773 | { | 1771 | { |
1774 | extern void ld_mmu_iommu(void); | ||
1775 | extern void ld_mmu_iounit(void); | ||
1776 | |||
1777 | /* Functions */ | 1772 | /* Functions */ |
1778 | get_srmmu_type(); | 1773 | get_srmmu_type(); |
1779 | 1774 | ||
diff --git a/arch/sparc/mm/srmmu.h b/arch/sparc/mm/srmmu.h deleted file mode 100644 index 5703274ccf89..000000000000 --- a/arch/sparc/mm/srmmu.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | /* srmmu.c */ | ||
2 | extern char *srmmu_name; | ||
3 | |||
4 | extern void (*poke_srmmu)(void); | ||