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
;
20 void cpucap_info(struct seq_file
*);
22 static inline unsigned long kimage_addr_to_ra(const void *p
)
24 unsigned long val
= (unsigned long) p
;
26 return kern_base
+ (val
- KERNBASE
);
30 asmlinkage
long sys_kern_features(void);
33 asmlinkage
void kernel_unaligned_trap(struct pt_regs
*regs
, unsigned int insn
);
34 int handle_popc(u32 insn
, struct pt_regs
*regs
);
35 void handle_lddfmna(struct pt_regs
*regs
, unsigned long sfar
, unsigned long sfsr
);
36 void handle_stdfmna(struct pt_regs
*regs
, unsigned long sfar
, unsigned long sfsr
);
39 void __irq_entry
smp_call_function_client(int irq
, struct pt_regs
*regs
);
40 void __irq_entry
smp_call_function_single_client(int irq
, struct pt_regs
*regs
);
41 void __irq_entry
smp_penguin_jailcell(int irq
, struct pt_regs
*regs
);
42 void __irq_entry
smp_receive_signal_client(int irq
, struct pt_regs
*regs
);
45 void __irq_entry
smp_kgdb_capture_client(int irq
, struct pt_regs
*regs
);
49 int ali_sound_dma_hack(struct device
*dev
, u64 device_mask
);
51 #define ali_sound_dma_hack(dev, mask) (0)
55 void do_sigreturn32(struct pt_regs
*regs
);
56 asmlinkage
void do_rt_sigreturn32(struct pt_regs
*regs
);
57 void do_signal32(struct pt_regs
* regs
);
58 asmlinkage
int do_sys32_sigstack(u32 u_ssptr
, u32 u_ossptr
, unsigned long sp
);
61 void __init
time_init_early(void);
64 extern unsigned int sparc32_dir_class
[];
65 extern unsigned int sparc32_chattr_class
[];
66 extern unsigned int sparc32_write_class
[];
67 extern unsigned int sparc32_read_class
[];
68 extern unsigned int sparc32_signal_class
[];
69 int sparc32_classify_syscall(unsigned int syscall
);
75 void sparc32_start_kernel(struct linux_romvec
*rp
);
81 void handle_hw_divzero(struct pt_regs
*regs
, unsigned long pc
,
82 unsigned long npc
, unsigned long psr
);
84 extern struct irqaction static_irqaction
[];
85 extern int static_irq_count
;
86 extern spinlock_t irq_action_lock
;
88 void unexpected_irq(int irq
, void *dev_id
, struct pt_regs
* regs
);
92 void sun4m_init_IRQ(void);
93 void sun4m_unmask_profile_irq(void);
94 void sun4m_clear_profile_irq(int cpu
);
97 void sun4m_cpu_pre_starting(void *arg
);
98 void sun4m_cpu_pre_online(void *arg
);
99 void __init
smp4m_boot_cpus(void);
100 int smp4m_boot_one_cpu(int i
, struct task_struct
*idle
);
101 void __init
smp4m_smp_done(void);
102 void smp4m_cross_call_irq(void);
103 void smp4m_percpu_timer_interrupt(struct pt_regs
*regs
);
106 extern spinlock_t sun4d_imsk_lock
;
108 void sun4d_init_IRQ(void);
109 int sun4d_request_irq(unsigned int irq
,
110 irq_handler_t handler
,
111 unsigned long irqflags
,
112 const char *devname
, void *dev_id
);
113 int show_sun4d_interrupts(struct seq_file
*, void *);
114 void sun4d_distribute_irqs(void);
115 void sun4d_free_irq(unsigned int irq
, void *dev_id
);
118 void sun4d_cpu_pre_starting(void *arg
);
119 void sun4d_cpu_pre_online(void *arg
);
120 void __init
smp4d_boot_cpus(void);
121 int smp4d_boot_one_cpu(int i
, struct task_struct
*idle
);
122 void __init
smp4d_smp_done(void);
123 void smp4d_cross_call_irq(void);
124 void smp4d_percpu_timer_interrupt(struct pt_regs
*regs
);
127 void leon_cpu_pre_starting(void *arg
);
128 void leon_cpu_pre_online(void *arg
);
129 void leonsmp_ipi_interrupt(void);
130 void leon_cross_call_irq(void);
133 extern unsigned int t_nmi
[];
134 extern unsigned int linux_trap_ipi15_sun4d
[];
135 extern unsigned int linux_trap_ipi15_sun4m
[];
137 extern struct tt_entry trapbase
;
138 extern struct tt_entry trapbase_cpu1
;
139 extern struct tt_entry trapbase_cpu2
;
140 extern struct tt_entry trapbase_cpu3
;
142 extern char cputypval
[];
145 extern unsigned long lvl14_save
[4];
146 extern unsigned int real_irq_entry
[];
147 extern unsigned int smp4d_ticker
[];
148 extern unsigned int patchme_maybe_smp_msg
[];
150 void floppy_hardint(void);
152 /* trampoline_32.S */
153 extern unsigned long sun4m_cpu_startup
;
154 extern unsigned long sun4d_cpu_startup
;
157 asmlinkage
int sparc_do_fork(unsigned long clone_flags
,
158 unsigned long stack_start
,
159 struct pt_regs
*regs
,
160 unsigned long stack_size
);
163 asmlinkage
void do_sigreturn(struct pt_regs
*regs
);
164 asmlinkage
void do_rt_sigreturn(struct pt_regs
*regs
);
165 void do_notify_resume(struct pt_regs
*regs
, unsigned long orig_i0
,
166 unsigned long thread_info_flags
);
167 asmlinkage
int do_sys_sigstack(struct sigstack __user
*ssptr
,
168 struct sigstack __user
*ossptr
,
172 asmlinkage
int syscall_trace(struct pt_regs
*regs
, int syscall_exit_p
);
175 asmlinkage
void kernel_unaligned_trap(struct pt_regs
*regs
, unsigned int insn
);
176 asmlinkage
void user_unaligned_trap(struct pt_regs
*regs
, unsigned int insn
);
179 void try_to_clear_window_buffer(struct pt_regs
*regs
, int who
);
182 void __init
auxio_probe(void);
183 void __init
auxio_power_probe(void);
186 extern void __iomem
*pcic_regs
;
187 void pcic_nmi(unsigned int pend
, struct pt_regs
*regs
);
190 void __init
time_init(void);
192 #else /* CONFIG_SPARC32 */
193 #endif /* CONFIG_SPARC32 */
194 #endif /* !(__SPARC_KERNEL_H) */