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