1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __SPARC_KERNEL_H
3 #define __SPARC_KERNEL_H
5 #include <linux/interrupt.h>
6 #include <linux/ftrace.h>
13 extern const char *sparc_pmu_type;
14 extern unsigned int fsr_storage;
15 extern int ncpus_probed;
17 /* process{_32,_64}.c */
18 asmlinkage long sparc_clone(struct pt_regs *regs);
19 asmlinkage long sparc_fork(struct pt_regs *regs);
20 asmlinkage long sparc_vfork(struct pt_regs *regs);
25 void cpucap_info(struct seq_file *);
27 static inline unsigned long kimage_addr_to_ra(const void *p)
29 unsigned long val = (unsigned long) p;
31 return kern_base + (val - KERNBASE);
35 asmlinkage long sys_kern_features(void);
38 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
39 int handle_popc(u32 insn, struct pt_regs *regs);
40 void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
41 void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr);
44 void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs);
45 void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs);
46 void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs);
47 void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs);
50 void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs);
54 int ali_sound_dma_hack(struct device *dev, u64 device_mask);
56 #define ali_sound_dma_hack(dev, mask) (0)
60 void do_sigreturn32(struct pt_regs *regs);
61 asmlinkage void do_rt_sigreturn32(struct pt_regs *regs);
62 void do_signal32(struct pt_regs * regs);
63 asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp);
66 void __init time_init_early(void);
69 extern unsigned int sparc32_dir_class[];
70 extern unsigned int sparc32_chattr_class[];
71 extern unsigned int sparc32_write_class[];
72 extern unsigned int sparc32_read_class[];
73 extern unsigned int sparc32_signal_class[];
74 int sparc32_classify_syscall(unsigned int syscall);
80 void sparc32_start_kernel(struct linux_romvec *rp);
86 void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
87 unsigned long npc, unsigned long psr);
89 extern struct irqaction static_irqaction[];
90 extern int static_irq_count;
91 extern spinlock_t irq_action_lock;
93 void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
96 void sun4m_init_IRQ(void);
97 void sun4m_unmask_profile_irq(void);
98 void sun4m_clear_profile_irq(int cpu);
101 void sun4m_cpu_pre_starting(void *arg);
102 void sun4m_cpu_pre_online(void *arg);
103 void __init smp4m_boot_cpus(void);
104 int smp4m_boot_one_cpu(int i, struct task_struct *idle);
105 void __init smp4m_smp_done(void);
106 void smp4m_cross_call_irq(void);
107 void smp4m_percpu_timer_interrupt(struct pt_regs *regs);
110 extern spinlock_t sun4d_imsk_lock;
112 void sun4d_init_IRQ(void);
113 int sun4d_request_irq(unsigned int irq,
114 irq_handler_t handler,
115 unsigned long irqflags,
116 const char *devname, void *dev_id);
117 int show_sun4d_interrupts(struct seq_file *, void *);
118 void sun4d_distribute_irqs(void);
119 void sun4d_free_irq(unsigned int irq, void *dev_id);
122 void sun4d_cpu_pre_starting(void *arg);
123 void sun4d_cpu_pre_online(void *arg);
124 void __init smp4d_boot_cpus(void);
125 int smp4d_boot_one_cpu(int i, struct task_struct *idle);
126 void __init smp4d_smp_done(void);
127 void smp4d_cross_call_irq(void);
128 void smp4d_percpu_timer_interrupt(struct pt_regs *regs);
131 void leon_cpu_pre_starting(void *arg);
132 void leon_cpu_pre_online(void *arg);
133 void leonsmp_ipi_interrupt(void);
134 void leon_cross_call_irq(void);
137 extern unsigned int t_nmi[];
138 extern unsigned int linux_trap_ipi15_sun4d[];
139 extern unsigned int linux_trap_ipi15_sun4m[];
141 extern struct tt_entry trapbase[];
142 extern struct tt_entry trapbase_cpu1[];
143 extern struct tt_entry trapbase_cpu2[];
144 extern struct tt_entry trapbase_cpu3[];
146 extern char cputypval[];
149 extern unsigned long lvl14_save[4];
150 extern unsigned int real_irq_entry[];
151 extern unsigned int smp4d_ticker[];
152 extern unsigned int patchme_maybe_smp_msg[];
154 void floppy_hardint(void);
156 /* trampoline_32.S */
157 extern unsigned long sun4m_cpu_startup;
158 extern unsigned long sun4d_cpu_startup;
161 asmlinkage void do_sigreturn(struct pt_regs *regs);
162 asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
163 void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
164 unsigned long thread_info_flags);
165 asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
166 struct sigstack __user *ossptr,
170 asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
173 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
174 asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn);
177 void try_to_clear_window_buffer(struct pt_regs *regs, int who);
180 void __init auxio_probe(void);
181 void __init auxio_power_probe(void);
184 extern void __iomem *pcic_regs;
185 void pcic_nmi(unsigned int pend, struct pt_regs *regs);
188 void __init time_init(void);
190 #else /* CONFIG_SPARC32 */
191 #endif /* CONFIG_SPARC32 */
192 #endif /* !(__SPARC_KERNEL_H) */