kernel.h (5787B)
1/* SPDX-License-Identifier: GPL-2.0 */ 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/* cpu.c */ 13extern const char *sparc_pmu_type; 14extern unsigned int fsr_storage; 15extern int ncpus_probed; 16 17/* process{_32,_64}.c */ 18asmlinkage long sparc_clone(struct pt_regs *regs); 19asmlinkage long sparc_fork(struct pt_regs *regs); 20asmlinkage long sparc_vfork(struct pt_regs *regs); 21 22#ifdef CONFIG_SPARC64 23/* setup_64.c */ 24struct seq_file; 25void cpucap_info(struct seq_file *); 26 27static inline unsigned long kimage_addr_to_ra(const void *p) 28{ 29 unsigned long val = (unsigned long) p; 30 31 return kern_base + (val - KERNBASE); 32} 33 34/* sys_sparc_64.c */ 35asmlinkage long sys_kern_features(void); 36 37/* unaligned_64.c */ 38asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 39int handle_popc(u32 insn, struct pt_regs *regs); 40void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); 41void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr); 42 43/* smp_64.c */ 44void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs); 45void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs); 46void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs); 47void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs); 48 49/* kgdb_64.c */ 50void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs); 51 52/* pci.c */ 53#ifdef CONFIG_PCI 54int ali_sound_dma_hack(struct device *dev, u64 device_mask); 55#else 56#define ali_sound_dma_hack(dev, mask) (0) 57#endif 58 59/* signal32.c */ 60void do_sigreturn32(struct pt_regs *regs); 61asmlinkage void do_rt_sigreturn32(struct pt_regs *regs); 62void do_signal32(struct pt_regs * regs); 63asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp); 64 65/* time_64.c */ 66void __init time_init_early(void); 67 68/* compat_audit.c */ 69extern unsigned int sparc32_dir_class[]; 70extern unsigned int sparc32_chattr_class[]; 71extern unsigned int sparc32_write_class[]; 72extern unsigned int sparc32_read_class[]; 73extern unsigned int sparc32_signal_class[]; 74int sparc32_classify_syscall(unsigned int syscall); 75#endif 76 77#ifdef CONFIG_SPARC32 78/* setup_32.c */ 79struct linux_romvec; 80void sparc32_start_kernel(struct linux_romvec *rp); 81 82/* cpu.c */ 83void cpu_probe(void); 84 85/* traps_32.c */ 86void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, 87 unsigned long npc, unsigned long psr); 88/* irq_32.c */ 89extern struct irqaction static_irqaction[]; 90extern int static_irq_count; 91extern spinlock_t irq_action_lock; 92 93void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); 94void init_IRQ(void); 95 96/* sun4m_irq.c */ 97void sun4m_init_IRQ(void); 98void sun4m_unmask_profile_irq(void); 99void sun4m_clear_profile_irq(int cpu); 100 101/* sun4m_smp.c */ 102void sun4m_cpu_pre_starting(void *arg); 103void sun4m_cpu_pre_online(void *arg); 104void __init smp4m_boot_cpus(void); 105int smp4m_boot_one_cpu(int i, struct task_struct *idle); 106void __init smp4m_smp_done(void); 107void smp4m_cross_call_irq(void); 108void smp4m_percpu_timer_interrupt(struct pt_regs *regs); 109 110/* sun4d_irq.c */ 111extern spinlock_t sun4d_imsk_lock; 112 113void sun4d_init_IRQ(void); 114int sun4d_request_irq(unsigned int irq, 115 irq_handler_t handler, 116 unsigned long irqflags, 117 const char *devname, void *dev_id); 118int show_sun4d_interrupts(struct seq_file *, void *); 119void sun4d_distribute_irqs(void); 120void sun4d_free_irq(unsigned int irq, void *dev_id); 121 122/* sun4d_smp.c */ 123void sun4d_cpu_pre_starting(void *arg); 124void sun4d_cpu_pre_online(void *arg); 125void __init smp4d_boot_cpus(void); 126int smp4d_boot_one_cpu(int i, struct task_struct *idle); 127void __init smp4d_smp_done(void); 128void smp4d_cross_call_irq(void); 129void smp4d_percpu_timer_interrupt(struct pt_regs *regs); 130 131/* leon_smp.c */ 132void leon_cpu_pre_starting(void *arg); 133void leon_cpu_pre_online(void *arg); 134void leonsmp_ipi_interrupt(void); 135void leon_cross_call_irq(void); 136 137/* head_32.S */ 138extern unsigned int t_nmi[]; 139extern unsigned int linux_trap_ipi15_sun4d[]; 140extern unsigned int linux_trap_ipi15_sun4m[]; 141 142extern struct tt_entry trapbase; 143extern struct tt_entry trapbase_cpu1; 144extern struct tt_entry trapbase_cpu2; 145extern struct tt_entry trapbase_cpu3; 146 147extern char cputypval[]; 148 149/* entry.S */ 150extern unsigned long lvl14_save[4]; 151extern unsigned int real_irq_entry[]; 152extern unsigned int smp4d_ticker[]; 153extern unsigned int patchme_maybe_smp_msg[]; 154 155void floppy_hardint(void); 156 157/* trampoline_32.S */ 158extern unsigned long sun4m_cpu_startup; 159extern unsigned long sun4d_cpu_startup; 160 161/* signal_32.c */ 162asmlinkage void do_sigreturn(struct pt_regs *regs); 163asmlinkage void do_rt_sigreturn(struct pt_regs *regs); 164void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, 165 unsigned long thread_info_flags); 166asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, 167 struct sigstack __user *ossptr, 168 unsigned long sp); 169 170/* ptrace_32.c */ 171asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); 172 173/* unaligned_32.c */ 174asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); 175asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); 176 177/* windows.c */ 178void try_to_clear_window_buffer(struct pt_regs *regs, int who); 179 180/* auxio_32.c */ 181void __init auxio_probe(void); 182void __init auxio_power_probe(void); 183 184/* pcic.c */ 185extern void __iomem *pcic_regs; 186void pcic_nmi(unsigned int pend, struct pt_regs *regs); 187 188/* time_32.c */ 189void __init time_init(void); 190 191#else /* CONFIG_SPARC32 */ 192#endif /* CONFIG_SPARC32 */ 193#endif /* !(__SPARC_KERNEL_H) */