blob: 52542419795cee691294b64274df2e64ba1d2d47 [file] [log] [blame]
Sam Ravnborg7105de82008-12-08 01:07:47 -08001#ifndef __SPARC_KERNEL_H
2#define __SPARC_KERNEL_H
Sam Ravnborg81265fd2008-12-08 01:08:24 -08003
4#include <linux/interrupt.h>
5
Sam Ravnborga2a211c2011-02-25 22:59:20 -08006#include <asm/traps.h>
David S. Millerea5e7442011-08-01 23:27:17 -07007#include <asm/head.h>
8#include <asm/io.h>
Sam Ravnborga2a211c2011-02-25 22:59:20 -08009
Sam Ravnborg53ae3412008-12-07 00:02:08 -080010/* cpu.c */
David S. Millerc3cf5e82009-01-21 23:16:40 -080011extern const char *sparc_pmu_type;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080012extern unsigned int fsr_storage;
Sam Ravnborgcb1b8202011-04-21 15:45:45 -070013extern int ncpus_probed;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080014
David S. Millerac85fe82011-07-28 23:31:26 -070015#ifdef CONFIG_SPARC64
16/* setup_64.c */
17struct seq_file;
18extern void cpucap_info(struct seq_file *);
David S. Millerea5e7442011-08-01 23:27:17 -070019
20static inline unsigned long kimage_addr_to_ra(const char *p)
21{
22 unsigned long val = (unsigned long) p;
23
24 return kern_base + (val - KERNBASE);
25}
David S. Millerac85fe82011-07-28 23:31:26 -070026#endif
27
Sam Ravnborg8d74e322008-12-08 01:04:59 -080028#ifdef CONFIG_SPARC32
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000029/* setup_32.c */
Sam Ravnborg178f0ff2014-05-16 23:25:39 +020030struct linux_romvec;
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000031void sparc32_start_kernel(struct linux_romvec *rp);
32
Sam Ravnborg8d74e322008-12-08 01:04:59 -080033/* cpu.c */
Sam Ravnborg53ae3412008-12-07 00:02:08 -080034extern void cpu_probe(void);
35
Sam Ravnborg8d74e322008-12-08 01:04:59 -080036/* traps_32.c */
37extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
38 unsigned long npc, unsigned long psr);
Sam Ravnborg81265fd2008-12-08 01:08:24 -080039/* irq_32.c */
40extern struct irqaction static_irqaction[];
41extern int static_irq_count;
42extern spinlock_t irq_action_lock;
43
44extern void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000045extern void init_IRQ(void);
46
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000047/* sun4m_irq.c */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000048extern void sun4m_init_IRQ(void);
Sam Ravnborg6baa9b22011-04-18 11:25:44 +000049extern void sun4m_unmask_profile_irq(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000050extern void sun4m_clear_profile_irq(int cpu);
51
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010052/* sun4m_smp.c */
53void sun4m_cpu_pre_starting(void *arg);
54void sun4m_cpu_pre_online(void *arg);
Sam Ravnborgb8417de2014-04-21 21:39:42 +020055void __init smp4m_boot_cpus(void);
56int smp4m_boot_one_cpu(int i, struct task_struct *idle);
57void __init smp4m_smp_done(void);
58void smp4m_cross_call_irq(void);
59void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010060
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000061/* sun4d_irq.c */
62extern spinlock_t sun4d_imsk_lock;
63
64extern void sun4d_init_IRQ(void);
65extern int sun4d_request_irq(unsigned int irq,
66 irq_handler_t handler,
67 unsigned long irqflags,
68 const char *devname, void *dev_id);
69extern int show_sun4d_interrupts(struct seq_file *, void *);
70extern void sun4d_distribute_irqs(void);
71extern void sun4d_free_irq(unsigned int irq, void *dev_id);
72
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010073/* sun4d_smp.c */
74void sun4d_cpu_pre_starting(void *arg);
75void sun4d_cpu_pre_online(void *arg);
Sam Ravnborg65199b02014-04-21 21:39:43 +020076void __init smp4d_boot_cpus(void);
77int smp4d_boot_one_cpu(int i, struct task_struct *idle);
78void __init smp4d_smp_done(void);
79void smp4d_cross_call_irq(void);
80void smp4d_percpu_timer_interrupt(struct pt_regs *regs);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010081
82/* leon_smp.c */
83void leon_cpu_pre_starting(void *arg);
84void leon_cpu_pre_online(void *arg);
Sam Ravnborg1bbc9062014-04-21 21:39:44 +020085void leonsmp_ipi_interrupt(void);
86void leon_cross_call_irq(void);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010087
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000088/* head_32.S */
89extern unsigned int t_nmi[];
90extern unsigned int linux_trap_ipi15_sun4d[];
91extern unsigned int linux_trap_ipi15_sun4m[];
92
Sam Ravnborga2a211c2011-02-25 22:59:20 -080093extern struct tt_entry trapbase_cpu1;
94extern struct tt_entry trapbase_cpu2;
95extern struct tt_entry trapbase_cpu3;
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000096
97extern char cputypval[];
98
99/* entry.S */
100extern unsigned long lvl14_save[4];
101extern unsigned int real_irq_entry[];
102extern unsigned int smp4d_ticker[];
103extern unsigned int patchme_maybe_smp_msg[];
104
105extern void floppy_hardint(void);
106
107/* trampoline_32.S */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000108extern unsigned long sun4m_cpu_startup;
109extern unsigned long sun4d_cpu_startup;
Sam Ravnborg81265fd2008-12-08 01:08:24 -0800110
Sam Ravnborg8bdd5a12014-04-21 21:39:25 +0200111/* process_32.c */
112asmlinkage int sparc_do_fork(unsigned long clone_flags,
113 unsigned long stack_start,
114 struct pt_regs *regs,
115 unsigned long stack_size);
116
Sam Ravnborg529b17a2014-04-21 21:39:26 +0200117/* signal_32.c */
118asmlinkage void do_sigreturn(struct pt_regs *regs);
119asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
120void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
121 unsigned long thread_info_flags);
122asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
123 struct sigstack __user *ossptr,
124 unsigned long sp);
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200125
Sam Ravnborgc8c87822014-04-21 21:39:37 +0200126/* ptrace_32.c */
127asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
128
Sam Ravnborg9edfae32014-04-21 21:39:38 +0200129/* unaligned_32.c */
130asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
131asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
132
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200133/* windows.c */
134void try_to_clear_window_buffer(struct pt_regs *regs, int who);
135
Sam Ravnborg6b5f02f2014-04-21 21:39:32 +0200136/* tadpole.c */
137void __init clock_stop_probe(void);
138
Sam Ravnborga3ee8fa2014-04-21 21:39:35 +0200139/* auxio_32.c */
140void __init auxio_probe(void);
141void __init auxio_power_probe(void);
142
Sam Ravnborg77389252014-05-16 23:25:42 +0200143/* pcic.c */
144extern void __iomem *pcic_regs;
145void pcic_nmi(unsigned int pend, struct pt_regs *regs);
146
Sam Ravnborg8d74e322008-12-08 01:04:59 -0800147#else /* CONFIG_SPARC32 */
Sam Ravnborg7105de82008-12-08 01:07:47 -0800148#endif /* CONFIG_SPARC32 */
149#endif /* !(__SPARC_KERNEL_H) */