blob: e7f652be9e61efee4ff9b64418ad17ac6a3eca63 [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 Ravnborg48c7eca2014-05-16 23:26:09 +020044/* kgdb_64.c */
45void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs);
46
Sam Ravnborg4ac7b822014-05-16 23:25:58 +020047/* pci.c */
48int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask);
49
Sam Ravnborgabaff452014-05-16 23:26:00 +020050/* signal32.c */
51void do_sigreturn32(struct pt_regs *regs);
52asmlinkage void do_rt_sigreturn32(struct pt_regs *regs);
53void do_signal32(struct pt_regs * regs);
54asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp);
55
Sam Ravnborga1ca1872014-05-16 23:26:08 +020056/* compat_audit.c */
57extern unsigned sparc32_dir_class[];
58extern unsigned sparc32_chattr_class[];
59extern unsigned sparc32_write_class[];
60extern unsigned sparc32_read_class[];
61extern unsigned sparc32_signal_class[];
62int sparc32_classify_syscall(unsigned syscall);
David S. Millerac85fe82011-07-28 23:31:26 -070063#endif
64
Sam Ravnborg8d74e322008-12-08 01:04:59 -080065#ifdef CONFIG_SPARC32
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000066/* setup_32.c */
Sam Ravnborg178f0ff2014-05-16 23:25:39 +020067struct linux_romvec;
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000068void sparc32_start_kernel(struct linux_romvec *rp);
69
Sam Ravnborg8d74e322008-12-08 01:04:59 -080070/* cpu.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020071void cpu_probe(void);
Sam Ravnborg53ae3412008-12-07 00:02:08 -080072
Sam Ravnborg8d74e322008-12-08 01:04:59 -080073/* traps_32.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020074void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
75 unsigned long npc, unsigned long psr);
Sam Ravnborg81265fd2008-12-08 01:08:24 -080076/* irq_32.c */
77extern struct irqaction static_irqaction[];
78extern int static_irq_count;
79extern spinlock_t irq_action_lock;
80
Sam Ravnborg2e74a742014-05-16 23:25:51 +020081void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
82void init_IRQ(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000083
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000084/* sun4m_irq.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020085void sun4m_init_IRQ(void);
86void sun4m_unmask_profile_irq(void);
87void sun4m_clear_profile_irq(int cpu);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000088
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010089/* sun4m_smp.c */
90void sun4m_cpu_pre_starting(void *arg);
91void sun4m_cpu_pre_online(void *arg);
Sam Ravnborgb8417de2014-04-21 21:39:42 +020092void __init smp4m_boot_cpus(void);
93int smp4m_boot_one_cpu(int i, struct task_struct *idle);
94void __init smp4m_smp_done(void);
95void smp4m_cross_call_irq(void);
96void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010097
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000098/* sun4d_irq.c */
99extern spinlock_t sun4d_imsk_lock;
100
Sam Ravnborg2e74a742014-05-16 23:25:51 +0200101void sun4d_init_IRQ(void);
102int sun4d_request_irq(unsigned int irq,
103 irq_handler_t handler,
104 unsigned long irqflags,
105 const char *devname, void *dev_id);
106int show_sun4d_interrupts(struct seq_file *, void *);
107void sun4d_distribute_irqs(void);
108void sun4d_free_irq(unsigned int irq, void *dev_id);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000109
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100110/* sun4d_smp.c */
111void sun4d_cpu_pre_starting(void *arg);
112void sun4d_cpu_pre_online(void *arg);
Sam Ravnborg65199b02014-04-21 21:39:43 +0200113void __init smp4d_boot_cpus(void);
114int smp4d_boot_one_cpu(int i, struct task_struct *idle);
115void __init smp4d_smp_done(void);
116void smp4d_cross_call_irq(void);
117void smp4d_percpu_timer_interrupt(struct pt_regs *regs);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100118
119/* leon_smp.c */
120void leon_cpu_pre_starting(void *arg);
121void leon_cpu_pre_online(void *arg);
Sam Ravnborg1bbc9062014-04-21 21:39:44 +0200122void leonsmp_ipi_interrupt(void);
123void leon_cross_call_irq(void);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100124
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000125/* head_32.S */
126extern unsigned int t_nmi[];
127extern unsigned int linux_trap_ipi15_sun4d[];
128extern unsigned int linux_trap_ipi15_sun4m[];
129
Sam Ravnborga2a211c2011-02-25 22:59:20 -0800130extern struct tt_entry trapbase_cpu1;
131extern struct tt_entry trapbase_cpu2;
132extern struct tt_entry trapbase_cpu3;
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000133
134extern char cputypval[];
135
136/* entry.S */
137extern unsigned long lvl14_save[4];
138extern unsigned int real_irq_entry[];
139extern unsigned int smp4d_ticker[];
140extern unsigned int patchme_maybe_smp_msg[];
141
Sam Ravnborg2e74a742014-05-16 23:25:51 +0200142void floppy_hardint(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000143
144/* trampoline_32.S */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000145extern unsigned long sun4m_cpu_startup;
146extern unsigned long sun4d_cpu_startup;
Sam Ravnborg81265fd2008-12-08 01:08:24 -0800147
Sam Ravnborg8bdd5a12014-04-21 21:39:25 +0200148/* process_32.c */
149asmlinkage int sparc_do_fork(unsigned long clone_flags,
150 unsigned long stack_start,
151 struct pt_regs *regs,
152 unsigned long stack_size);
153
Sam Ravnborg529b17a2014-04-21 21:39:26 +0200154/* signal_32.c */
155asmlinkage void do_sigreturn(struct pt_regs *regs);
156asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
157void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
158 unsigned long thread_info_flags);
159asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
160 struct sigstack __user *ossptr,
161 unsigned long sp);
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200162
Sam Ravnborgc8c87822014-04-21 21:39:37 +0200163/* ptrace_32.c */
164asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
165
Sam Ravnborg9edfae32014-04-21 21:39:38 +0200166/* unaligned_32.c */
167asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
168asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
169
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200170/* windows.c */
171void try_to_clear_window_buffer(struct pt_regs *regs, int who);
172
Sam Ravnborga3ee8fa2014-04-21 21:39:35 +0200173/* auxio_32.c */
174void __init auxio_probe(void);
175void __init auxio_power_probe(void);
176
Sam Ravnborg77389252014-05-16 23:25:42 +0200177/* pcic.c */
178extern void __iomem *pcic_regs;
179void pcic_nmi(unsigned int pend, struct pt_regs *regs);
180
Sam Ravnborgfcea8b22014-05-16 23:25:44 +0200181/* time_32.c */
182void __init time_init(void);
183
Sam Ravnborg8d74e322008-12-08 01:04:59 -0800184#else /* CONFIG_SPARC32 */
Sam Ravnborg7105de82008-12-08 01:07:47 -0800185#endif /* CONFIG_SPARC32 */
186#endif /* !(__SPARC_KERNEL_H) */