blob: eeb87f7224ca12c8a071934f957d5caa4d88f743 [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>
Sam Ravnborga0c54a22014-05-16 23:25:57 +02005#include <linux/ftrace.h>
Sam Ravnborg81265fd2008-12-08 01:08:24 -08006
Sam Ravnborga2a211c2011-02-25 22:59:20 -08007#include <asm/traps.h>
David S. Millerea5e7442011-08-01 23:27:17 -07008#include <asm/head.h>
9#include <asm/io.h>
Sam Ravnborga2a211c2011-02-25 22:59:20 -080010
Sam Ravnborg53ae3412008-12-07 00:02:08 -080011/* cpu.c */
David S. Millerc3cf5e82009-01-21 23:16:40 -080012extern const char *sparc_pmu_type;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080013extern unsigned int fsr_storage;
Sam Ravnborgcb1b8202011-04-21 15:45:45 -070014extern int ncpus_probed;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080015
David S. Millerac85fe82011-07-28 23:31:26 -070016#ifdef CONFIG_SPARC64
17/* setup_64.c */
18struct seq_file;
Sam Ravnborg2e74a742014-05-16 23:25:51 +020019void cpucap_info(struct seq_file *);
David S. Millerea5e7442011-08-01 23:27:17 -070020
Sam Ravnborga0c54a22014-05-16 23:25:57 +020021static inline unsigned long kimage_addr_to_ra(const void *p)
David S. Millerea5e7442011-08-01 23:27:17 -070022{
23 unsigned long val = (unsigned long) p;
24
25 return kern_base + (val - KERNBASE);
26}
Sam Ravnborg8df52622014-05-16 23:25:54 +020027
28/* sys_sparc_64.c */
29asmlinkage long sys_kern_features(void);
30
31/* unaligned_64.c */
32asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
33int handle_popc(u32 insn, struct pt_regs *regs);
34void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
35void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
36
Sam Ravnborga0c54a22014-05-16 23:25:57 +020037/* smp_64.c */
38void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs);
39void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs);
40void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs);
41void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs);
42void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs);
43
Sam Ravnborg4ac7b822014-05-16 23:25:58 +020044/* pci.c */
45int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask);
46
David S. Millerac85fe82011-07-28 23:31:26 -070047#endif
48
Sam Ravnborg8d74e322008-12-08 01:04:59 -080049#ifdef CONFIG_SPARC32
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000050/* setup_32.c */
Sam Ravnborg178f0ff2014-05-16 23:25:39 +020051struct linux_romvec;
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000052void sparc32_start_kernel(struct linux_romvec *rp);
53
Sam Ravnborg8d74e322008-12-08 01:04:59 -080054/* cpu.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020055void cpu_probe(void);
Sam Ravnborg53ae3412008-12-07 00:02:08 -080056
Sam Ravnborg8d74e322008-12-08 01:04:59 -080057/* traps_32.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020058void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
59 unsigned long npc, unsigned long psr);
Sam Ravnborg81265fd2008-12-08 01:08:24 -080060/* irq_32.c */
61extern struct irqaction static_irqaction[];
62extern int static_irq_count;
63extern spinlock_t irq_action_lock;
64
Sam Ravnborg2e74a742014-05-16 23:25:51 +020065void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
66void init_IRQ(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000067
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000068/* sun4m_irq.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020069void sun4m_init_IRQ(void);
70void sun4m_unmask_profile_irq(void);
71void sun4m_clear_profile_irq(int cpu);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000072
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010073/* sun4m_smp.c */
74void sun4m_cpu_pre_starting(void *arg);
75void sun4m_cpu_pre_online(void *arg);
Sam Ravnborgb8417de2014-04-21 21:39:42 +020076void __init smp4m_boot_cpus(void);
77int smp4m_boot_one_cpu(int i, struct task_struct *idle);
78void __init smp4m_smp_done(void);
79void smp4m_cross_call_irq(void);
80void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010081
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000082/* sun4d_irq.c */
83extern spinlock_t sun4d_imsk_lock;
84
Sam Ravnborg2e74a742014-05-16 23:25:51 +020085void sun4d_init_IRQ(void);
86int sun4d_request_irq(unsigned int irq,
87 irq_handler_t handler,
88 unsigned long irqflags,
89 const char *devname, void *dev_id);
90int show_sun4d_interrupts(struct seq_file *, void *);
91void sun4d_distribute_irqs(void);
92void sun4d_free_irq(unsigned int irq, void *dev_id);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000093
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010094/* sun4d_smp.c */
95void sun4d_cpu_pre_starting(void *arg);
96void sun4d_cpu_pre_online(void *arg);
Sam Ravnborg65199b02014-04-21 21:39:43 +020097void __init smp4d_boot_cpus(void);
98int smp4d_boot_one_cpu(int i, struct task_struct *idle);
99void __init smp4d_smp_done(void);
100void smp4d_cross_call_irq(void);
101void smp4d_percpu_timer_interrupt(struct pt_regs *regs);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100102
103/* leon_smp.c */
104void leon_cpu_pre_starting(void *arg);
105void leon_cpu_pre_online(void *arg);
Sam Ravnborg1bbc9062014-04-21 21:39:44 +0200106void leonsmp_ipi_interrupt(void);
107void leon_cross_call_irq(void);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100108
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000109/* head_32.S */
110extern unsigned int t_nmi[];
111extern unsigned int linux_trap_ipi15_sun4d[];
112extern unsigned int linux_trap_ipi15_sun4m[];
113
Sam Ravnborga2a211c2011-02-25 22:59:20 -0800114extern struct tt_entry trapbase_cpu1;
115extern struct tt_entry trapbase_cpu2;
116extern struct tt_entry trapbase_cpu3;
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000117
118extern char cputypval[];
119
120/* entry.S */
121extern unsigned long lvl14_save[4];
122extern unsigned int real_irq_entry[];
123extern unsigned int smp4d_ticker[];
124extern unsigned int patchme_maybe_smp_msg[];
125
Sam Ravnborg2e74a742014-05-16 23:25:51 +0200126void floppy_hardint(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000127
128/* trampoline_32.S */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000129extern unsigned long sun4m_cpu_startup;
130extern unsigned long sun4d_cpu_startup;
Sam Ravnborg81265fd2008-12-08 01:08:24 -0800131
Sam Ravnborg8bdd5a12014-04-21 21:39:25 +0200132/* process_32.c */
133asmlinkage int sparc_do_fork(unsigned long clone_flags,
134 unsigned long stack_start,
135 struct pt_regs *regs,
136 unsigned long stack_size);
137
Sam Ravnborg529b17a2014-04-21 21:39:26 +0200138/* signal_32.c */
139asmlinkage void do_sigreturn(struct pt_regs *regs);
140asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
141void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
142 unsigned long thread_info_flags);
143asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
144 struct sigstack __user *ossptr,
145 unsigned long sp);
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200146
Sam Ravnborgc8c87822014-04-21 21:39:37 +0200147/* ptrace_32.c */
148asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
149
Sam Ravnborg9edfae32014-04-21 21:39:38 +0200150/* unaligned_32.c */
151asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
152asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
153
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200154/* windows.c */
155void try_to_clear_window_buffer(struct pt_regs *regs, int who);
156
Sam Ravnborga3ee8fa2014-04-21 21:39:35 +0200157/* auxio_32.c */
158void __init auxio_probe(void);
159void __init auxio_power_probe(void);
160
Sam Ravnborg77389252014-05-16 23:25:42 +0200161/* pcic.c */
162extern void __iomem *pcic_regs;
163void pcic_nmi(unsigned int pend, struct pt_regs *regs);
164
Sam Ravnborgfcea8b22014-05-16 23:25:44 +0200165/* time_32.c */
166void __init time_init(void);
167
Sam Ravnborg8d74e322008-12-08 01:04:59 -0800168#else /* CONFIG_SPARC32 */
Sam Ravnborg7105de82008-12-08 01:07:47 -0800169#endif /* CONFIG_SPARC32 */
170#endif /* !(__SPARC_KERNEL_H) */