1
2#ifndef __SPARC_KERNEL_H
3#define __SPARC_KERNEL_H
4
5#include <linux/interrupt.h>
6#include <linux/ftrace.h>
7
8#include <asm/traps.h>
9#include <asm/head.h>
10#include <asm/io.h>
11
12
13extern const char *sparc_pmu_type;
14extern unsigned int fsr_storage;
15extern int ncpus_probed;
16
17#ifdef CONFIG_SPARC64
18
19struct seq_file;
20void cpucap_info(struct seq_file *);
21
22static inline unsigned long kimage_addr_to_ra(const void *p)
23{
24 unsigned long val = (unsigned long) p;
25
26 return kern_base + (val - KERNBASE);
27}
28
29
30asmlinkage long sys_kern_features(void);
31
32
33asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
34int handle_popc(u32 insn, struct pt_regs *regs);
35void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
36void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
37
38
39void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs);
40void __irq_entry smp_call_function_single_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
44
45void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs);
46
47
48int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask);
49
50
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
56
57void __init time_init_early(void);
58
59
60extern unsigned int sparc32_dir_class[];
61extern unsigned int sparc32_chattr_class[];
62extern unsigned int sparc32_write_class[];
63extern unsigned int sparc32_read_class[];
64extern unsigned int sparc32_signal_class[];
65int sparc32_classify_syscall(unsigned int syscall);
66#endif
67
68#ifdef CONFIG_SPARC32
69
70struct linux_romvec;
71void sparc32_start_kernel(struct linux_romvec *rp);
72
73
74void cpu_probe(void);
75
76
77void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
78 unsigned long npc, unsigned long psr);
79
80extern struct irqaction static_irqaction[];
81extern int static_irq_count;
82extern spinlock_t irq_action_lock;
83
84void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
85void init_IRQ(void);
86
87
88void sun4m_init_IRQ(void);
89void sun4m_unmask_profile_irq(void);
90void sun4m_clear_profile_irq(int cpu);
91
92
93void sun4m_cpu_pre_starting(void *arg);
94void sun4m_cpu_pre_online(void *arg);
95void __init smp4m_boot_cpus(void);
96int smp4m_boot_one_cpu(int i, struct task_struct *idle);
97void __init smp4m_smp_done(void);
98void smp4m_cross_call_irq(void);
99void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
100
101
102extern spinlock_t sun4d_imsk_lock;
103
104void sun4d_init_IRQ(void);
105int sun4d_request_irq(unsigned int irq,
106 irq_handler_t handler,
107 unsigned long irqflags,
108 const char *devname, void *dev_id);
109int show_sun4d_interrupts(struct seq_file *, void *);
110void sun4d_distribute_irqs(void);
111void sun4d_free_irq(unsigned int irq, void *dev_id);
112
113
114void sun4d_cpu_pre_starting(void *arg);
115void sun4d_cpu_pre_online(void *arg);
116void __init smp4d_boot_cpus(void);
117int smp4d_boot_one_cpu(int i, struct task_struct *idle);
118void __init smp4d_smp_done(void);
119void smp4d_cross_call_irq(void);
120void smp4d_percpu_timer_interrupt(struct pt_regs *regs);
121
122
123void leon_cpu_pre_starting(void *arg);
124void leon_cpu_pre_online(void *arg);
125void leonsmp_ipi_interrupt(void);
126void leon_cross_call_irq(void);
127
128
129extern unsigned int t_nmi[];
130extern unsigned int linux_trap_ipi15_sun4d[];
131extern unsigned int linux_trap_ipi15_sun4m[];
132
133extern struct tt_entry trapbase;
134extern struct tt_entry trapbase_cpu1;
135extern struct tt_entry trapbase_cpu2;
136extern struct tt_entry trapbase_cpu3;
137
138extern char cputypval[];
139
140
141extern unsigned long lvl14_save[4];
142extern unsigned int real_irq_entry[];
143extern unsigned int smp4d_ticker[];
144extern unsigned int patchme_maybe_smp_msg[];
145
146void floppy_hardint(void);
147
148
149extern unsigned long sun4m_cpu_startup;
150extern unsigned long sun4d_cpu_startup;
151
152
153asmlinkage int sparc_do_fork(unsigned long clone_flags,
154 unsigned long stack_start,
155 struct pt_regs *regs,
156 unsigned long stack_size);
157
158
159asmlinkage void do_sigreturn(struct pt_regs *regs);
160asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
161void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
162 unsigned long thread_info_flags);
163asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
164 struct sigstack __user *ossptr,
165 unsigned long sp);
166
167
168asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
169
170
171asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
172asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
173
174
175void try_to_clear_window_buffer(struct pt_regs *regs, int who);
176
177
178void __init auxio_probe(void);
179void __init auxio_power_probe(void);
180
181
182extern void __iomem *pcic_regs;
183void pcic_nmi(unsigned int pend, struct pt_regs *regs);
184
185
186void __init time_init(void);
187
188#else
189#endif
190#endif
191