Commit 8cf749a8 authored by David S. Miller's avatar David S. Miller

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.
====================
parents 2aafe1a4 1bbc9060
#ifndef ___ASM_SPARC_AUXIO_H #ifndef ___ASM_SPARC_AUXIO_H
#define ___ASM_SPARC_AUXIO_H #define ___ASM_SPARC_AUXIO_H
#ifndef __ASSEMBLY__
extern void __iomem *auxio_register;
#endif /* ifndef __ASSEMBLY__ */
#if defined(__sparc__) && defined(__arch64__) #if defined(__sparc__) && defined(__arch64__)
#include <asm/auxio_64.h> #include <asm/auxio_64.h>
#else #else
......
...@@ -75,8 +75,6 @@ ...@@ -75,8 +75,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void __iomem *auxio_register;
#define AUXIO_LTE_ON 1 #define AUXIO_LTE_ON 1
#define AUXIO_LTE_OFF 0 #define AUXIO_LTE_OFF 0
......
...@@ -20,6 +20,6 @@ extern void do_BUG(const char *file, int line); ...@@ -20,6 +20,6 @@ extern void do_BUG(const char *file, int line);
#include <asm-generic/bug.h> #include <asm-generic/bug.h>
struct pt_regs; struct pt_regs;
extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn)); void __noreturn die_if_kernel(char *str, struct pt_regs *regs);
#endif #endif
#ifndef ___ASM_SPARC_CPUDATA_H #ifndef ___ASM_SPARC_CPUDATA_H
#define ___ASM_SPARC_CPUDATA_H #define ___ASM_SPARC_CPUDATA_H
#ifndef __ASSEMBLY__
#include <linux/threads.h>
#include <linux/percpu.h>
extern const struct seq_operations cpuinfo_op;
#endif /* !(__ASSEMBLY__) */
#if defined(__sparc__) && defined(__arch64__) #if defined(__sparc__) && defined(__arch64__)
#include <asm/cpudata_64.h> #include <asm/cpudata_64.h>
#else #else
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/percpu.h>
#include <linux/threads.h>
typedef struct { typedef struct {
/* Dcache line 1 */ /* Dcache line 1 */
unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
...@@ -35,8 +32,6 @@ DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); ...@@ -35,8 +32,6 @@ DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu)) #define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
#define local_cpu_data() __get_cpu_var(__cpu_data) #define local_cpu_data() __get_cpu_var(__cpu_data)
extern const struct seq_operations cpuinfo_op;
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
#include <asm/trap_block.h> #include <asm/trap_block.h>
......
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/idprom.h> #include <asm/idprom.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/auxio.h> #include <asm/auxio.h>
#include <asm/setup.h>
#include <asm/page.h>
#include <asm/irq.h> #include <asm/irq.h>
/* We don't need no stinkin' I/O port allocation crap. */ /* We don't need no stinkin' I/O port allocation crap. */
...@@ -49,7 +50,6 @@ struct sun_flpy_controller { ...@@ -49,7 +50,6 @@ struct sun_flpy_controller {
/* You'll only ever find one controller on a SparcStation anyways. */ /* You'll only ever find one controller on a SparcStation anyways. */
static struct sun_flpy_controller *sun_fdc = NULL; static struct sun_flpy_controller *sun_fdc = NULL;
extern volatile unsigned char *fdc_status;
struct sun_floppy_ops { struct sun_floppy_ops {
unsigned char (*fd_inb)(int port); unsigned char (*fd_inb)(int port);
...@@ -212,13 +212,6 @@ static void sun_82077_fd_outb(unsigned char value, int port) ...@@ -212,13 +212,6 @@ static void sun_82077_fd_outb(unsigned char value, int port)
* underruns. If non-zero, doing_pdma encodes the direction of * underruns. If non-zero, doing_pdma encodes the direction of
* the transfer for debugging. 1=read 2=write * the transfer for debugging. 1=read 2=write
*/ */
extern char *pdma_vaddr;
extern unsigned long pdma_size;
extern volatile int doing_pdma;
/* This is software state */
extern char *pdma_base;
extern unsigned long pdma_areasize;
/* Common routines to all controller types on the Sparc. */ /* Common routines to all controller types on the Sparc. */
static inline void virtual_dma_init(void) static inline void virtual_dma_init(void)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#define irq_canonicalize(irq) (irq) #define irq_canonicalize(irq) (irq)
extern void __init init_IRQ(void); extern void __init init_IRQ(void);
void __init sun4d_init_sbi_irq(void);
#define NO_IRQ 0xffffffff #define NO_IRQ 0xffffffff
......
...@@ -14,6 +14,8 @@ struct page; ...@@ -14,6 +14,8 @@ struct page;
void *srmmu_get_nocache(int size, int align); void *srmmu_get_nocache(int size, int align);
void srmmu_free_nocache(void *addr, int size); void srmmu_free_nocache(void *addr, int size);
extern struct resource sparc_iomap;
#define check_pgt_cache() do { } while (0) #define check_pgt_cache() do { } while (0)
pgd_t *get_pgd_fast(void); pgd_t *get_pgd_fast(void);
......
...@@ -27,6 +27,7 @@ struct page; ...@@ -27,6 +27,7 @@ struct page;
extern void load_mmu(void); extern void load_mmu(void);
extern unsigned long calc_highpages(void); extern unsigned long calc_highpages(void);
unsigned long __init bootmem_init(unsigned long *pages_avail);
#define pte_ERROR(e) __builtin_trap() #define pte_ERROR(e) __builtin_trap()
#define pmd_ERROR(e) __builtin_trap() #define pmd_ERROR(e) __builtin_trap()
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
#ifndef _SPARC_SETUP_H #ifndef _SPARC_SETUP_H
#define _SPARC_SETUP_H #define _SPARC_SETUP_H
#include <uapi/asm/setup.h> #include <linux/interrupt.h>
#include <uapi/asm/setup.h>
extern char reboot_command[]; extern char reboot_command[];
...@@ -22,6 +23,28 @@ static inline int con_is_present(void) ...@@ -22,6 +23,28 @@ static inline int con_is_present(void)
{ {
return serial_console ? 0 : 1; return serial_console ? 0 : 1;
} }
/* from irq_32.c */
extern volatile unsigned char *fdc_status;
extern char *pdma_vaddr;
extern unsigned long pdma_size;
extern volatile int doing_pdma;
/* This is software state */
extern char *pdma_base;
extern unsigned long pdma_areasize;
int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler);
/* setup_32.c */
extern unsigned long cmdline_memory_size;
/* devices.c */
void __init device_scan(void);
/* unaligned_32.c */
unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int);
#endif #endif
extern void sun_do_break(void); extern void sun_do_break(void);
......
...@@ -32,7 +32,7 @@ static inline unsigned int timer_value(unsigned int value) ...@@ -32,7 +32,7 @@ static inline unsigned int timer_value(unsigned int value)
return (value + 1) << TIMER_VALUE_SHIFT; return (value + 1) << TIMER_VALUE_SHIFT;
} }
extern __volatile__ unsigned int *master_l10_counter; extern volatile unsigned int __iomem *master_l10_counter;
extern irqreturn_t notrace timer_interrupt(int dummy, void *dev_id); extern irqreturn_t notrace timer_interrupt(int dummy, void *dev_id);
......
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/export.h> #include <linux/export.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/auxio.h> #include <asm/auxio.h>
#include <asm/string.h> /* memset(), Linux has no bzero() */ #include <asm/string.h> /* memset(), Linux has no bzero() */
#include <asm/cpu_type.h> #include <asm/cpu_type.h>
#include "kernel.h"
/* Probe and map in the Auxiliary I/O register */ /* Probe and map in the Auxiliary I/O register */
/* auxio_register is not static because it is referenced /* auxio_register is not static because it is referenced
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <asm/cpudata.h> #include <asm/cpudata.h>
#include "kernel.h" #include "kernel.h"
#include "entry.h"
DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
EXPORT_PER_CPU_SYMBOL(__cpu_data); EXPORT_PER_CPU_SYMBOL(__cpu_data);
......
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/cpudata.h> #include <asm/cpudata.h>
#include <asm/cpu_type.h> #include <asm/cpu_type.h>
#include <asm/setup.h>
extern void clock_stop_probe(void); /* tadpole.c */ #include "kernel.h"
static char *cpu_mid_prop(void) static char *cpu_mid_prop(void)
{ {
...@@ -131,11 +132,7 @@ void __init device_scan(void) ...@@ -131,11 +132,7 @@ void __init device_scan(void)
} }
#endif /* !CONFIG_SMP */ #endif /* !CONFIG_SMP */
{ auxio_probe();
extern void auxio_probe(void); auxio_power_probe();
extern void auxio_power_probe(void);
auxio_probe();
auxio_power_probe();
}
clock_stop_probe(); clock_stop_probe();
} }
...@@ -186,7 +186,7 @@ static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys, ...@@ -186,7 +186,7 @@ static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys,
if (name == NULL) name = "???"; if (name == NULL) name = "???";
if ((xres = xres_alloc()) != 0) { if ((xres = xres_alloc()) != NULL) {
tack = xres->xname; tack = xres->xname;
res = &xres->xres; res = &xres->xres;
} else { } else {
...@@ -400,7 +400,7 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg, ...@@ -400,7 +400,7 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
BUG(); BUG();
} }
struct dma_map_ops sbus_dma_ops = { static struct dma_map_ops sbus_dma_ops = {
.alloc = sbus_alloc_coherent, .alloc = sbus_alloc_coherent,
.free = sbus_free_coherent, .free = sbus_free_coherent,
.map_page = sbus_map_page, .map_page = sbus_map_page,
...@@ -681,7 +681,7 @@ static int sparc_io_proc_show(struct seq_file *m, void *v) ...@@ -681,7 +681,7 @@ static int sparc_io_proc_show(struct seq_file *m, void *v)
const char *nm; const char *nm;
for (r = root->child; r != NULL; r = r->sibling) { for (r = root->child; r != NULL; r = r->sibling) {
if ((nm = r->name) == 0) nm = "???"; if ((nm = r->name) == NULL) nm = "???";
seq_printf(m, "%016llx-%016llx: %s\n", seq_printf(m, "%016llx-%016llx: %s\n",
(unsigned long long)r->start, (unsigned long long)r->start,
(unsigned long long)r->end, nm); (unsigned long long)r->end, nm);
......
...@@ -82,6 +82,15 @@ void handler_irq(unsigned int pil, struct pt_regs *regs); ...@@ -82,6 +82,15 @@ void handler_irq(unsigned int pil, struct pt_regs *regs);
unsigned long leon_get_irqmask(unsigned int irq); unsigned long leon_get_irqmask(unsigned int irq);
/* irq_32.c */
void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs);
/* sun4m_irq.c */
void sun4m_nmi(struct pt_regs *regs);
/* sun4d_irq.c */
void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cpudata.h> #include <asm/cpudata.h>
#include <asm/setup.h>
#include <asm/pcic.h> #include <asm/pcic.h>
#include <asm/leon.h> #include <asm/leon.h>
......
...@@ -51,6 +51,11 @@ extern void sun4m_clear_profile_irq(int cpu); ...@@ -51,6 +51,11 @@ extern void sun4m_clear_profile_irq(int cpu);
/* sun4m_smp.c */ /* sun4m_smp.c */
void sun4m_cpu_pre_starting(void *arg); void sun4m_cpu_pre_starting(void *arg);
void sun4m_cpu_pre_online(void *arg); void sun4m_cpu_pre_online(void *arg);
void __init smp4m_boot_cpus(void);
int smp4m_boot_one_cpu(int i, struct task_struct *idle);
void __init smp4m_smp_done(void);
void smp4m_cross_call_irq(void);
void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
/* sun4d_irq.c */ /* sun4d_irq.c */
extern spinlock_t sun4d_imsk_lock; extern spinlock_t sun4d_imsk_lock;
...@@ -67,10 +72,17 @@ extern void sun4d_free_irq(unsigned int irq, void *dev_id); ...@@ -67,10 +72,17 @@ extern void sun4d_free_irq(unsigned int irq, void *dev_id);
/* sun4d_smp.c */ /* sun4d_smp.c */
void sun4d_cpu_pre_starting(void *arg); void sun4d_cpu_pre_starting(void *arg);
void sun4d_cpu_pre_online(void *arg); void sun4d_cpu_pre_online(void *arg);
void __init smp4d_boot_cpus(void);
int smp4d_boot_one_cpu(int i, struct task_struct *idle);
void __init smp4d_smp_done(void);
void smp4d_cross_call_irq(void);
void smp4d_percpu_timer_interrupt(struct pt_regs *regs);
/* leon_smp.c */ /* leon_smp.c */
void leon_cpu_pre_starting(void *arg); void leon_cpu_pre_starting(void *arg);
void leon_cpu_pre_online(void *arg); void leon_cpu_pre_online(void *arg);
void leonsmp_ipi_interrupt(void);
void leon_cross_call_irq(void);
/* head_32.S */ /* head_32.S */
extern unsigned int t_nmi[]; extern unsigned int t_nmi[];
...@@ -95,6 +107,38 @@ extern void floppy_hardint(void); ...@@ -95,6 +107,38 @@ extern void floppy_hardint(void);
extern unsigned long sun4m_cpu_startup; extern unsigned long sun4m_cpu_startup;
extern unsigned long sun4d_cpu_startup; extern unsigned long sun4d_cpu_startup;
/* process_32.c */
asmlinkage int sparc_do_fork(unsigned long clone_flags,
unsigned long stack_start,
struct pt_regs *regs,
unsigned long stack_size);
/* signal_32.c */
asmlinkage void do_sigreturn(struct pt_regs *regs);
asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
unsigned long thread_info_flags);
asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
struct sigstack __user *ossptr,
unsigned long sp);
/* ptrace_32.c */
asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
/* unaligned_32.c */
asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
/* windows.c */
void try_to_clear_window_buffer(struct pt_regs *regs, int who);
/* tadpole.c */
void __init clock_stop_probe(void);
/* auxio_32.c */
void __init auxio_probe(void);
void __init auxio_power_probe(void);
#else /* CONFIG_SPARC32 */ #else /* CONFIG_SPARC32 */
#endif /* CONFIG_SPARC32 */ #endif /* CONFIG_SPARC32 */
#endif /* !(__SPARC_KERNEL_H) */ #endif /* !(__SPARC_KERNEL_H) */
...@@ -32,12 +32,12 @@ struct leon3_gptimer_regs_map *leon3_gptimer_regs; /* timer controller base addr ...@@ -32,12 +32,12 @@ struct leon3_gptimer_regs_map *leon3_gptimer_regs; /* timer controller base addr
int leondebug_irq_disable; int leondebug_irq_disable;
int leon_debug_irqout; int leon_debug_irqout;
static int dummy_master_l10_counter; static volatile unsigned int dummy_master_l10_counter;
unsigned long amba_system_id; unsigned long amba_system_id;
static DEFINE_SPINLOCK(leon_irq_lock); static DEFINE_SPINLOCK(leon_irq_lock);
static unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */
unsigned long leon3_gptimer_irq; /* interrupt controller irq number */ unsigned long leon3_gptimer_irq; /* interrupt controller irq number */
unsigned long leon3_gptimer_idx; /* Timer Index (0..6) within Timer Core */
unsigned int sparc_leon_eirq; unsigned int sparc_leon_eirq;
#define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu]) #define LEON_IMASK(cpu) (&leon3_irqctrl_regs->mask[cpu])
#define LEON_IACK (&leon3_irqctrl_regs->iclear) #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,7 +65,7 @@ static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc)
} }
/* The extended IRQ controller has been found, this function registers it */ /* The extended IRQ controller has been found, this function registers it */
void leon_eirq_setup(unsigned int eirq) static void leon_eirq_setup(unsigned int eirq)
{ {
unsigned long mask, oldmask; unsigned long mask, oldmask;
unsigned int veirq; unsigned int veirq;
...@@ -270,7 +270,7 @@ static u32 leon_cycles_offset(void) ...@@ -270,7 +270,7 @@ static u32 leon_cycles_offset(void)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* smp clockevent irq */ /* smp clockevent irq */
irqreturn_t leon_percpu_timer_ce_interrupt(int irq, void *unused) static irqreturn_t leon_percpu_timer_ce_interrupt(int irq, void *unused)
{ {
struct clock_event_device *ce; struct clock_event_device *ce;
int cpu = smp_processor_id(); int cpu = smp_processor_id();
...@@ -313,7 +313,8 @@ void __init leon_init_timers(void) ...@@ -313,7 +313,8 @@ void __init leon_init_timers(void)
leondebug_irq_disable = 0; leondebug_irq_disable = 0;
leon_debug_irqout = 0; leon_debug_irqout = 0;
master_l10_counter = (unsigned int *)&dummy_master_l10_counter; master_l10_counter =
(unsigned int __iomem *)&dummy_master_l10_counter;
dummy_master_l10_counter = 0; dummy_master_l10_counter = 0;
rootnp = of_find_node_by_path("/ambapp0"); rootnp = of_find_node_by_path("/ambapp0");
......
...@@ -80,7 +80,7 @@ struct grpci1_regs { ...@@ -80,7 +80,7 @@ struct grpci1_regs {
struct grpci1_priv { struct grpci1_priv {
struct leon_pci_info info; /* must be on top of this structure */ struct leon_pci_info info; /* must be on top of this structure */
struct grpci1_regs *regs; /* GRPCI register map */ struct grpci1_regs __iomem *regs; /* GRPCI register map */
struct device *dev; struct device *dev;
int pci_err_mask; /* STATUS register error mask */ int pci_err_mask; /* STATUS register error mask */
int irq; /* LEON irqctrl GRPCI IRQ */ int irq; /* LEON irqctrl GRPCI IRQ */
...@@ -101,7 +101,7 @@ static struct grpci1_priv *grpci1priv; ...@@ -101,7 +101,7 @@ static struct grpci1_priv *grpci1priv;
static int grpci1_cfg_w32(struct grpci1_priv *priv, unsigned int bus, static int grpci1_cfg_w32(struct grpci1_priv *priv, unsigned int bus,
unsigned int devfn, int where, u32 val); unsigned int devfn, int where, u32 val);
int grpci1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) static int grpci1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{ {
struct grpci1_priv *priv = dev->bus->sysdata; struct grpci1_priv *priv = dev->bus->sysdata;
int irq_group; int irq_group;
...@@ -417,10 +417,10 @@ static unsigned int grpci1_build_device_irq(unsigned int irq) ...@@ -417,10 +417,10 @@ static unsigned int grpci1_build_device_irq(unsigned int irq)
* BAR1: peripheral DMA to host's memory (size at least 256MByte) * BAR1: peripheral DMA to host's memory (size at least 256MByte)
* BAR2..BAR5: not implemented in hardware * BAR2..BAR5: not implemented in hardware
*/ */
void grpci1_hw_init(struct grpci1_priv *priv) static void grpci1_hw_init(struct grpci1_priv *priv)
{ {
u32 ahbadr, bar_sz, data, pciadr; u32 ahbadr, bar_sz, data, pciadr;
struct grpci1_regs *regs = priv->regs; struct grpci1_regs __iomem *regs = priv->regs;
/* set 1:1 mapping between AHB -> PCI memory space */ /* set 1:1 mapping between AHB -> PCI memory space */
REGSTORE(regs->cfg_stat, priv->pci_area & 0xf0000000); REGSTORE(regs->cfg_stat, priv->pci_area & 0xf0000000);
...@@ -509,7 +509,7 @@ static irqreturn_t grpci1_err_interrupt(int irq, void *arg) ...@@ -509,7 +509,7 @@ static irqreturn_t grpci1_err_interrupt(int irq, void *arg)
static int grpci1_of_probe(struct platform_device *ofdev) static int grpci1_of_probe(struct platform_device *ofdev)
{ {
struct grpci1_regs *regs; struct grpci1_regs __iomem *regs;
struct grpci1_priv *priv; struct grpci1_priv *priv;
int err, len; int err, len;
const int *tmp; const int *tmp;
...@@ -690,7 +690,7 @@ static int grpci1_of_probe(struct platform_device *ofdev) ...@@ -690,7 +690,7 @@ static int grpci1_of_probe(struct platform_device *ofdev)
err2: err2:
release_resource(&priv->info.mem_space); release_resource(&priv->info.mem_space);
err1: err1:
iounmap((void *)priv->pci_io_va); iounmap((void __iomem *)priv->pci_io_va);
grpci1priv = NULL; grpci1priv = NULL;
return err; return err;
} }
......
...@@ -191,7 +191,7 @@ struct grpci2_cap_first { ...@@ -191,7 +191,7 @@ struct grpci2_cap_first {
struct grpci2_priv { struct grpci2_priv {
struct leon_pci_info info; /* must be on top of this structure */ struct leon_pci_info info; /* must be on top of this structure */
struct grpci2_regs *regs; struct grpci2_regs __iomem *regs;
char irq; char irq;
char irq_mode; /* IRQ Mode from CAPSTS REG */ char irq_mode; /* IRQ Mode from CAPSTS REG */
char bt_enabled; char bt_enabled;
...@@ -215,10 +215,10 @@ struct grpci2_priv { ...@@ -215,10 +215,10 @@ struct grpci2_priv {
struct grpci2_barcfg tgtbars[6]; struct grpci2_barcfg tgtbars[6];
}; };
DEFINE_SPINLOCK(grpci2_dev_lock); static DEFINE_SPINLOCK(grpci2_dev_lock);
struct grpci2_priv *grpci2priv; static struct grpci2_priv *grpci2priv;
int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) static int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{ {
struct grpci2_priv *priv = dev->bus->sysdata; struct grpci2_priv *priv = dev->bus->sysdata;
int irq_group; int irq_group;
...@@ -561,10 +561,10 @@ static unsigned int grpci2_build_device_irq(unsigned int irq) ...@@ -561,10 +561,10 @@ static unsigned int grpci2_build_device_irq(unsigned int irq)
return virq; return virq;
} }
void grpci2_hw_init(struct grpci2_priv *priv) static void grpci2_hw_init(struct grpci2_priv *priv)
{ {
u32 ahbadr, pciadr, bar_sz, capptr, io_map, data; u32 ahbadr, pciadr, bar_sz, capptr, io_map, data;
struct grpci2_regs *regs = priv->regs; struct grpci2_regs __iomem *regs = priv->regs;
int i; int i;
struct grpci2_barcfg *barcfg = priv->tgtbars; struct grpci2_barcfg *barcfg = priv->tgtbars;
...@@ -655,7 +655,7 @@ static irqreturn_t grpci2_jump_interrupt(int irq, void *arg) ...@@ -655,7 +655,7 @@ static irqreturn_t grpci2_jump_interrupt(int irq, void *arg)
static irqreturn_t grpci2_err_interrupt(int irq, void *arg) static irqreturn_t grpci2_err_interrupt(int irq, void *arg)
{ {
struct grpci2_priv *priv = arg; struct grpci2_priv *priv = arg;
struct grpci2_regs *regs = priv->regs; struct grpci2_regs __iomem *regs = priv->regs;
unsigned int status; unsigned int status;
status = REGLOAD(regs->sts_cap); status = REGLOAD(regs->sts_cap);
...@@ -682,7 +682,7 @@ static irqreturn_t grpci2_err_interrupt(int irq, void *arg) ...@@ -682,7 +682,7 @@ static irqreturn_t grpci2_err_interrupt(int irq, void *arg)
static int grpci2_of_probe(struct platform_device *ofdev) static int grpci2_of_probe(struct platform_device *ofdev)
{ {
struct grpci2_regs *regs; struct grpci2_regs __iomem *regs;
struct grpci2_priv *priv; struct grpci2_priv *priv;
int err, i, len; int err, i, len;
const int *tmp; const int *tmp;
...@@ -878,7 +878,7 @@ static int grpci2_of_probe(struct platform_device *ofdev) ...@@ -878,7 +878,7 @@ static int grpci2_of_probe(struct platform_device *ofdev)
release_resource(&priv->info.mem_space); release_resource(&priv->info.mem_space);
err3: err3:
err = -ENOMEM; err = -ENOMEM;
iounmap((void *)priv->pci_io_va); iounmap((void __iomem *)priv->pci_io_va);
err2: err2:
kfree(priv); kfree(priv);
err1: err1:
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
#include <asm/processor.h> #include <asm/processor.h>
/* List of Systems that need fixup instructions around power-down instruction */ /* List of Systems that need fixup instructions around power-down instruction */
unsigned int pmc_leon_fixup_ids[] = { static unsigned int pmc_leon_fixup_ids[] = {
AEROFLEX_UT699, AEROFLEX_UT699,
GAISLER_GR712RC, GAISLER_GR712RC,
LEON4_NEXTREME1, LEON4_NEXTREME1,
0 0
}; };
int pmc_leon_need_fixup(void) static int pmc_leon_need_fixup(void)
{ {
unsigned int systemid = amba_system_id >> 16; unsigned int systemid = amba_system_id >> 16;
unsigned int *id; unsigned int *id;
...@@ -38,7 +38,7 @@ int pmc_leon_need_fixup(void) ...@@ -38,7 +38,7 @@ int pmc_leon_need_fixup(void)
* CPU idle callback function for systems that need some extra handling * CPU idle callback function for systems that need some extra handling
* See .../arch/sparc/kernel/process.c * See .../arch/sparc/kernel/process.c
*/ */
void pmc_leon_idle_fixup(void) static void pmc_leon_idle_fixup(void)
{ {
/* Prepare an address to a non-cachable region. APB is always /* Prepare an address to a non-cachable region. APB is always
* none-cachable. One instruction is executed after the Sleep * none-cachable. One instruction is executed after the Sleep
...@@ -62,7 +62,7 @@ void pmc_leon_idle_fixup(void) ...@@ -62,7 +62,7 @@ void pmc_leon_idle_fixup(void)
* CPU idle callback function * CPU idle callback function
* See .../arch/sparc/kernel/process.c * See .../arch/sparc/kernel/process.c
*/ */
void pmc_leon_idle(void) static void pmc_leon_idle(void)
{ {
/* Interrupts need to be enabled to not hang the CPU */ /* Interrupts need to be enabled to not hang the CPU */
local_irq_enable(); local_irq_enable();
......
...@@ -130,7 +130,7 @@ void leon_configure_cache_smp(void) ...@@ -130,7 +130,7 @@ void leon_configure_cache_smp(void)
local_ops->tlb_all(); local_ops->tlb_all();
} }
void leon_smp_setbroadcast(unsigned int mask) static void leon_smp_setbroadcast(unsigned int mask)
{ {
int broadcast = int broadcast =
((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >> ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >>
...@@ -148,13 +148,6 @@ void leon_smp_setbroadcast(unsigned int mask) ...@@ -148,13 +148,6 @@ void leon_smp_setbroadcast(unsigned int mask)
LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask); LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask);
} }
unsigned int leon_smp_getbroadcast(void)
{
unsigned int mask;
mask = LEON_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpbroadcast));
return mask;
}
int leon_smp_nrcpus(void) int leon_smp_nrcpus(void)
{ {
int nrcpu = int nrcpu =
...@@ -266,10 +259,6 @@ void __init leon_smp_done(void) ...@@ -266,10 +259,6 @@ void __init leon_smp_done(void)
} }
void leon_irq_rotate(int cpu)
{
}
struct leon_ipi_work { struct leon_ipi_work {
int single; int single;
int msk; int msk;
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/of_device.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include "of_device_common.h" #include "of_device_common.h"
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <linux/elfcore.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/cpu.h>
#include <asm/auxio.h> #include <asm/auxio.h>
#include <asm/oplib.h> #include <asm/oplib.h>
...@@ -38,6 +40,8 @@ ...@@ -38,6 +40,8 @@
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/setup.h> #include <asm/setup.h>
#include "kernel.h"
/* /*
* Power management idle function * Power management idle function
* Set in pm platform drivers (apc.c and pmc.c) * Set in pm platform drivers (apc.c and pmc.c)
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include "kernel.h"
/* #define ALLOW_INIT_TRACING */ /* #define ALLOW_INIT_TRACING */
/* /*
......
...@@ -267,7 +267,7 @@ static __init void leon_patch(void) ...@@ -267,7 +267,7 @@ static __init void leon_patch(void)
} }
struct tt_entry *sparc_ttable; struct tt_entry *sparc_ttable;
struct pt_regs fake_swapper_regs; static struct pt_regs fake_swapper_regs;
/* Called from head_32.S - before we have setup anything /* Called from head_32.S - before we have setup anything
* in the kernel. Be very careful with what you do here. * in the kernel. Be very careful with what you do here.
...@@ -365,7 +365,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -365,7 +365,7 @@ void __init setup_arch(char **cmdline_p)
prom_setsync(prom_sync_me); prom_setsync(prom_sync_me);
if((boot_flags&BOOTME_DEBUG) && (linux_dbvec!=0) && if((boot_flags & BOOTME_DEBUG) && (linux_dbvec != NULL) &&
((*(short *)linux_dbvec) != -1)) { ((*(short *)linux_dbvec) != -1)) {
printk("Booted under KADB. Syncing trap table.\n"); printk("Booted under KADB. Syncing trap table.\n");
(*(linux_dbvec->teach_debugger))(); (*(linux_dbvec->teach_debugger))();
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <asm/switch_to.h> #include <asm/switch_to.h>
#include "sigutil.h" #include "sigutil.h"
#include "kernel.h"
extern void fpsave(unsigned long *fpregs, unsigned long *fsr, extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
void *fpqueue, unsigned long *fpqdepth); void *fpqueue, unsigned long *fpqdepth);
...@@ -341,7 +342,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs, ...@@ -341,7 +342,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs,
err |= __put_user(0, &sf->extra_size); err |= __put_user(0, &sf->extra_size);
if (psr & PSR_EF) { if (psr & PSR_EF) {
__siginfo_fpu_t *fp = tail; __siginfo_fpu_t __user *fp = tail;
tail += sizeof(*fp); tail += sizeof(*fp);
err |= save_fpu_state(regs, fp); err |= save_fpu_state(regs, fp);
err |= __put_user(fp, &sf->fpu_save); err |= __put_user(fp, &sf->fpu_save);
...@@ -349,7 +350,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs, ...@@ -349,7 +350,7 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs,
err |= __put_user(0, &sf->fpu_save); err |= __put_user(0, &sf->fpu_save);
} }
if (wsaved) { if (wsaved) {
__siginfo_rwin_t *rwp = tail; __siginfo_rwin_t __user *rwp = tail;
tail += sizeof(*rwp); tail += sizeof(*rwp);
err |= save_rwin_state(wsaved, rwp); err |= save_rwin_state(wsaved, rwp);
err |= __put_user(rwp, &sf->rwin_save); err |= __put_user(rwp, &sf->rwin_save);
...@@ -517,9 +518,9 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, ...@@ -517,9 +518,9 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
} }
} }
asmlinkage int asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr, struct sigstack __user *ossptr,
unsigned long sp) unsigned long sp)
{ {
int ret = -EFAULT; int ret = -EFAULT;
......
...@@ -75,8 +75,6 @@ void smp_store_cpu_info(int id) ...@@ -75,8 +75,6 @@ void smp_store_cpu_info(int id)
void __init smp_cpus_done(unsigned int max_cpus) void __init smp_cpus_done(unsigned int max_cpus)
{ {
extern void smp4m_smp_done(void);
extern void smp4d_smp_done(void);
unsigned long bogosum = 0; unsigned long bogosum = 0;
int cpu, num = 0; int cpu, num = 0;
...@@ -183,8 +181,6 @@ int setup_profiling_timer(unsigned int multiplier) ...@@ -183,8 +181,6 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus) void __init smp_prepare_cpus(unsigned int max_cpus)
{ {
extern void __init smp4m_boot_cpus(void);
extern void __init smp4d_boot_cpus(void);
int i, cpuid, extra; int i, cpuid, extra;
printk("Entering SMP Mode...\n"); printk("Entering SMP Mode...\n");
...@@ -261,8 +257,6 @@ void __init smp_prepare_boot_cpu(void) ...@@ -261,8 +257,6 @@ void __init smp_prepare_boot_cpu(void)
int __cpu_up(unsigned int cpu, struct task_struct *tidle) int __cpu_up(unsigned int cpu, struct task_struct *tidle)
{ {
extern int smp4m_boot_one_cpu(int, struct task_struct *);
extern int smp4d_boot_one_cpu(int, struct task_struct *);
int ret=0; int ret=0;
switch(sparc_cpu_model) { switch(sparc_cpu_model) {
...@@ -297,7 +291,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) ...@@ -297,7 +291,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
return ret; return ret;
} }
void arch_cpu_pre_starting(void *arg) static void arch_cpu_pre_starting(void *arg)
{ {
local_ops->cache_all(); local_ops->cache_all();
local_ops->tlb_all(); local_ops->tlb_all();
...@@ -317,7 +311,7 @@ void arch_cpu_pre_starting(void *arg) ...@@ -317,7 +311,7 @@ void arch_cpu_pre_starting(void *arg)
} }
} }
void arch_cpu_pre_online(void *arg) static void arch_cpu_pre_online(void *arg)
{ {
unsigned int cpuid = hard_smp_processor_id(); unsigned int cpuid = hard_smp_processor_id();
...@@ -344,7 +338,7 @@ void arch_cpu_pre_online(void *arg) ...@@ -344,7 +338,7 @@ void arch_cpu_pre_online(void *arg)
} }
} }
void sparc_start_secondary(void *arg) static void sparc_start_secondary(void *arg)
{ {
unsigned int cpu; unsigned int cpu;
......
...@@ -143,7 +143,7 @@ static void sun4d_sbus_handler_irq(int sbusl) ...@@ -143,7 +143,7 @@ static void sun4d_sbus_handler_irq(int sbusl)
} }
} }
void sun4d_handler_irq(int pil, struct pt_regs *regs) void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs)
{ {
struct pt_regs *old_regs; struct pt_regs *old_regs;
/* SBUS IRQ level (1 - 7) */ /* SBUS IRQ level (1 - 7) */
...@@ -236,7 +236,7 @@ static void sun4d_shutdown_irq(struct irq_data *data) ...@@ -236,7 +236,7 @@ static void sun4d_shutdown_irq(struct irq_data *data)
irq_unlink(data->irq); irq_unlink(data->irq);
} }
struct irq_chip sun4d_irq = { static struct irq_chip sun4d_irq = {
.name = "sun4d", .name = "sun4d",
.irq_startup = sun4d_startup_irq, .irq_startup = sun4d_startup_irq,
.irq_shutdown = sun4d_shutdown_irq, .irq_shutdown = sun4d_shutdown_irq,
...@@ -285,9 +285,9 @@ static void __init sun4d_load_profile_irqs(void) ...@@ -285,9 +285,9 @@ static void __init sun4d_load_profile_irqs(void)
} }
} }
unsigned int _sun4d_build_device_irq(unsigned int real_irq, static unsigned int _sun4d_build_device_irq(unsigned int real_irq,
unsigned int pil, unsigned int pil,
unsigned int board) unsigned int board)
{ {
struct sun4d_handler_data *handler_data; struct sun4d_handler_data *handler_data;
unsigned int irq; unsigned int irq;
...@@ -320,8 +320,8 @@ unsigned int _sun4d_build_device_irq(unsigned int real_irq, ...@@ -320,8 +320,8 @@ unsigned int _sun4d_build_device_irq(unsigned int real_irq,
unsigned int sun4d_build_device_irq(struct platform_device *op, static unsigned int sun4d_build_device_irq(struct platform_device *op,
unsigned int real_irq) unsigned int real_irq)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
struct device_node *board_parent, *bus = dp->parent; struct device_node *board_parent, *bus = dp->parent;
...@@ -383,7 +383,8 @@ unsigned int sun4d_build_device_irq(struct platform_device *op, ...@@ -383,7 +383,8 @@ unsigned int sun4d_build_device_irq(struct platform_device *op,
return irq; return irq;
} }
unsigned int sun4d_build_timer_irq(unsigned int board, unsigned int real_irq) static unsigned int sun4d_build_timer_irq(unsigned int board,
unsigned int real_irq)
{ {
return _sun4d_build_device_irq(real_irq, real_irq, board); return _sun4d_build_device_irq(real_irq, real_irq, board);
} }
......
...@@ -12,13 +12,17 @@ ...@@ -12,13 +12,17 @@
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/io.h> #include <asm/io.h>
#include "kernel.h"
#define MACIO_SCSI_CSR_ADDR 0x78400000 #define MACIO_SCSI_CSR_ADDR 0x78400000
#define MACIO_EN_DMA 0x00000200 #define MACIO_EN_DMA 0x00000200
#define CLOCK_INIT_DONE 1 #define CLOCK_INIT_DONE 1
static int clk_state; static int clk_state;
static volatile unsigned char *clk_ctrl; static volatile unsigned char *clk_ctrl;
void (*cpu_pwr_save)(void);
/* TODO - cpu_pwr_save is only assigned - cleanup potential. */
static void (*cpu_pwr_save)(void);
static inline unsigned int ldphys(unsigned int addr) static inline unsigned int ldphys(unsigned int addr)
{ {
......
...@@ -83,7 +83,7 @@ unsigned long profile_pc(struct pt_regs *regs) ...@@ -83,7 +83,7 @@ unsigned long profile_pc(struct pt_regs *regs)
EXPORT_SYMBOL(profile_pc); EXPORT_SYMBOL(profile_pc);
__volatile__ unsigned int *master_l10_counter; volatile unsigned int __iomem *master_l10_counter;
int update_persistent_clock(struct timespec now) int update_persistent_clock(struct timespec now)
{ {
......
...@@ -44,7 +44,7 @@ static void instruction_dump(unsigned long *pc) ...@@ -44,7 +44,7 @@ static void instruction_dump(unsigned long *pc)
#define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t") #define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t")
#define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t") #define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t")
void die_if_kernel(char *str, struct pt_regs *regs) void __noreturn die_if_kernel(char *str, struct pt_regs *regs)
{ {
static int die_counter; static int die_counter;
int count = 0; int count = 0;
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <asm/setup.h>
#include "kernel.h"
enum direction { enum direction {
load, /* ld, ldd, ldh, ldsh */ load, /* ld, ldd, ldh, ldsh */
store, /* st, std, sth, stsh */ store, /* st, std, sth, stsh */
......
...@@ -10,8 +10,11 @@ ...@@ -10,8 +10,11 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <asm/cacheflush.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "kernel.h"
/* Do save's until all user register windows are out of the cpu. */ /* Do save's until all user register windows are out of the cpu. */
void flush_user_windows(void) void flush_user_windows(void)
{ {
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/openprom.h> #include <asm/openprom.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/setup.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
int show_unhandled_signals = 1; #include "mm_32.h"
static void unhandled_fault(unsigned long, struct task_struct *, int show_unhandled_signals = 1;
struct pt_regs *) __attribute__ ((noreturn));
static void __noreturn unhandled_fault(unsigned long address, static void __noreturn unhandled_fault(unsigned long address,
struct task_struct *tsk, struct task_struct *tsk,
...@@ -141,9 +141,6 @@ static void __do_fault_siginfo(int code, int sig, struct pt_regs *regs, ...@@ -141,9 +141,6 @@ static void __do_fault_siginfo(int code, int sig, struct pt_regs *regs,
force_sig_info (sig, &info, current); force_sig_info (sig, &info, current);
} }
extern unsigned long safe_compute_effective_address(struct pt_regs *,
unsigned int);
static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault) static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
{ {
unsigned int insn; unsigned int insn;
......
...@@ -31,10 +31,13 @@ ...@@ -31,10 +31,13 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/vaddrs.h> #include <asm/vaddrs.h>
#include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */ #include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */
#include <asm/setup.h>
#include <asm/tlb.h> #include <asm/tlb.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/leon.h> #include <asm/leon.h>
#include "mm_32.h"
unsigned long *sparc_valid_addr_bitmap; unsigned long *sparc_valid_addr_bitmap;
EXPORT_SYMBOL(sparc_valid_addr_bitmap); EXPORT_SYMBOL(sparc_valid_addr_bitmap);
...@@ -63,7 +66,6 @@ void show_mem(unsigned int filter) ...@@ -63,7 +66,6 @@ void show_mem(unsigned int filter)
} }
extern unsigned long cmdline_memory_size;
unsigned long last_valid_pfn; unsigned long last_valid_pfn;
unsigned long calc_highpages(void) unsigned long calc_highpages(void)
...@@ -246,9 +248,6 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) ...@@ -246,9 +248,6 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
* init routine based upon the Sun model type on the Sparc. * init routine based upon the Sun model type on the Sparc.
* *
*/ */
extern void srmmu_paging_init(void);
extern void device_scan(void);
void __init paging_init(void) void __init paging_init(void)
{ {
srmmu_paging_init(); srmmu_paging_init();
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <asm/iommu.h> #include <asm/iommu.h>
#include <asm/dma.h> #include <asm/dma.h>
#include "mm_32.h"
/* /*
* This can be sized dynamically, but we will do this * This can be sized dynamically, but we will do this
* only when we have a guidance about actual I/O pressures. * only when we have a guidance about actual I/O pressures.
...@@ -37,9 +39,6 @@ ...@@ -37,9 +39,6 @@
#define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */ #define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */
#define IOMMU_ORDER 6 /* 4096 * (1<<6) */ #define IOMMU_ORDER 6 /* 4096 * (1<<6) */
/* srmmu.c */
extern int viking_mxcc_present;
extern int flush_page_for_dma_global;
static int viking_flush; static int viking_flush;
/* viking.S */ /* viking.S */
extern void viking_flush_page(unsigned long page); extern void viking_flush_page(unsigned long page);
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
#include <asm/leon.h> #include <asm/leon.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include "srmmu.h" #include "mm_32.h"
int leon_flush_during_switch = 1; int leon_flush_during_switch = 1;
int srmmu_swprobe_trace; static int srmmu_swprobe_trace;
static inline unsigned long leon_get_ctable_ptr(void) static inline unsigned long leon_get_ctable_ptr(void)
{ {
......
/* fault_32.c - visible as they are called from assembler */
asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
unsigned long address);
asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
unsigned long address);
void window_overflow_fault(void);
void window_underflow_fault(unsigned long sp);
void window_ret_fault(struct pt_regs *regs);
/* srmmu.c */
extern char *srmmu_name;
extern int viking_mxcc_present;
extern int flush_page_for_dma_global;
extern void (*poke_srmmu)(void);
void __init srmmu_paging_init(void);
/* iommu.c */
void ld_mmu_iommu(void);
/* io-unit.c */
void ld_mmu_iounit(void);
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <asm/mxcc.h> #include <asm/mxcc.h>
#include <asm/ross.h> #include <asm/ross.h>
#include "srmmu.h" #include "mm_32.h"
enum mbus_module srmmu_modtype; enum mbus_module srmmu_modtype;
static unsigned int hwbug_bitmask; static unsigned int hwbug_bitmask;
...@@ -100,7 +100,6 @@ static unsigned long srmmu_nocache_end; ...@@ -100,7 +100,6 @@ static unsigned long srmmu_nocache_end;
#define SRMMU_NOCACHE_ALIGN_MAX (sizeof(ctxd_t)*SRMMU_MAX_CONTEXTS) #define SRMMU_NOCACHE_ALIGN_MAX (sizeof(ctxd_t)*SRMMU_MAX_CONTEXTS)
void *srmmu_nocache_pool; void *srmmu_nocache_pool;
void *srmmu_nocache_bitmap;
static struct bit_map srmmu_nocache_map; static struct bit_map srmmu_nocache_map;
static inline int srmmu_pmd_none(pmd_t pmd) static inline int srmmu_pmd_none(pmd_t pmd)
...@@ -173,7 +172,7 @@ static void *__srmmu_get_nocache(int size, int align) ...@@ -173,7 +172,7 @@ static void *__srmmu_get_nocache(int size, int align)
printk(KERN_ERR "srmmu: out of nocache %d: %d/%d\n", printk(KERN_ERR "srmmu: out of nocache %d: %d/%d\n",
size, (int) srmmu_nocache_size, size, (int) srmmu_nocache_size,
srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT); srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT);
return 0; return NULL;
} }
addr = SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT); addr = SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT);
...@@ -269,6 +268,7 @@ static void __init srmmu_nocache_calcsize(void) ...@@ -269,6 +268,7 @@ static void __init srmmu_nocache_calcsize(void)
static void __init srmmu_nocache_init(void) static void __init srmmu_nocache_init(void)
{ {
void *srmmu_nocache_bitmap;
unsigned int bitmap_bits; unsigned int bitmap_bits;
pgd_t *pgd; pgd_t *pgd;
pmd_t *pmd; pmd_t *pmd;
...@@ -728,7 +728,7 @@ static inline unsigned long srmmu_probe(unsigned long vaddr) ...@@ -728,7 +728,7 @@ static inline unsigned long srmmu_probe(unsigned long vaddr)
"=r" (retval) : "=r" (retval) :
"r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE));
} else { } else {
retval = leon_swprobe(vaddr, 0); retval = leon_swprobe(vaddr, NULL);
} }
return retval; return retval;
} }
...@@ -865,8 +865,6 @@ static void __init map_kernel(void) ...@@ -865,8 +865,6 @@ static void __init map_kernel(void)
void (*poke_srmmu)(void) = NULL; void (*poke_srmmu)(void) = NULL;
extern unsigned long bootmem_init(unsigned long *pages_avail);
void __init srmmu_paging_init(void) void __init srmmu_paging_init(void)
{ {
int i; int i;
...@@ -1771,9 +1769,6 @@ static struct sparc32_cachetlb_ops smp_cachetlb_ops = { ...@@ -1771,9 +1769,6 @@ static struct sparc32_cachetlb_ops smp_cachetlb_ops = {
/* Load up routines and constants for sun4m and sun4d mmu */ /* Load up routines and constants for sun4m and sun4d mmu */
void __init load_mmu(void) void __init load_mmu(void)
{ {
extern void ld_mmu_iommu(void);
extern void ld_mmu_iounit(void);
/* Functions */ /* Functions */
get_srmmu_type(); get_srmmu_type();
......
/* srmmu.c */
extern char *srmmu_name;
extern void (*poke_srmmu)(void);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment