blob: 9cd09a3ef35f5cd49d76bc3aebacc22eda8d5779 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sam Ravnborg7105de82008-12-08 01:07:47 -08002#ifndef __SPARC_KERNEL_H
3#define __SPARC_KERNEL_H
Sam Ravnborg81265fd2008-12-08 01:08:24 -08004
5#include <linux/interrupt.h>
Sam Ravnborga0c54a22014-05-16 23:25:57 +02006#include <linux/ftrace.h>
Sam Ravnborg81265fd2008-12-08 01:08:24 -08007
Sam Ravnborga2a211c2011-02-25 22:59:20 -08008#include <asm/traps.h>
David S. Millerea5e7442011-08-01 23:27:17 -07009#include <asm/head.h>
10#include <asm/io.h>
Sam Ravnborga2a211c2011-02-25 22:59:20 -080011
Sam Ravnborg53ae3412008-12-07 00:02:08 -080012/* cpu.c */
David S. Millerc3cf5e82009-01-21 23:16:40 -080013extern const char *sparc_pmu_type;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080014extern unsigned int fsr_storage;
Sam Ravnborgcb1b8202011-04-21 15:45:45 -070015extern int ncpus_probed;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080016
Christian Braunera4261d42020-05-12 19:15:26 +020017/* 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
David S. Millerac85fe82011-07-28 23:31:26 -070022#ifdef CONFIG_SPARC64
23/* setup_64.c */
24struct seq_file;
Sam Ravnborg2e74a742014-05-16 23:25:51 +020025void cpucap_info(struct seq_file *);
David S. Millerea5e7442011-08-01 23:27:17 -070026
Sam Ravnborga0c54a22014-05-16 23:25:57 +020027static inline unsigned long kimage_addr_to_ra(const void *p)
David S. Millerea5e7442011-08-01 23:27:17 -070028{
29 unsigned long val = (unsigned long) p;
30
31 return kern_base + (val - KERNBASE);
32}
Sam Ravnborg8df52622014-05-16 23:25:54 +020033
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
Sam Ravnborga0c54a22014-05-16 23:25:57 +020043/* 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);
Sam Ravnborga0c54a22014-05-16 23:25:57 +020046void __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
Sam Ravnborg48c7eca2014-05-16 23:26:09 +020049/* kgdb_64.c */
50void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs);
51
Sam Ravnborg4ac7b822014-05-16 23:25:58 +020052/* pci.c */
Christoph Hellwigc54fc982019-02-15 09:06:31 +010053#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
Sam Ravnborg4ac7b822014-05-16 23:25:58 +020058
Sam Ravnborgabaff452014-05-16 23:26:00 +020059/* 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
Pavel Tatashin83e8eb92017-06-12 16:41:46 -040065/* time_64.c */
66void __init time_init_early(void);
67
Sam Ravnborga1ca1872014-05-16 23:26:08 +020068/* compat_audit.c */
Joe Perches9ef595d2016-03-10 15:21:43 -080069extern 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);
David S. Millerac85fe82011-07-28 23:31:26 -070075#endif
76
Sam Ravnborg8d74e322008-12-08 01:04:59 -080077#ifdef CONFIG_SPARC32
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000078/* setup_32.c */
Sam Ravnborg178f0ff2014-05-16 23:25:39 +020079struct linux_romvec;
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000080void sparc32_start_kernel(struct linux_romvec *rp);
81
Sam Ravnborg8d74e322008-12-08 01:04:59 -080082/* cpu.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020083void cpu_probe(void);
Sam Ravnborg53ae3412008-12-07 00:02:08 -080084
Sam Ravnborg8d74e322008-12-08 01:04:59 -080085/* traps_32.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020086void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
87 unsigned long npc, unsigned long psr);
Sam Ravnborg81265fd2008-12-08 01:08:24 -080088/* irq_32.c */
89extern struct irqaction static_irqaction[];
90extern int static_irq_count;
91extern spinlock_t irq_action_lock;
92
Sam Ravnborg2e74a742014-05-16 23:25:51 +020093void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
94void init_IRQ(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000095
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000096/* sun4m_irq.c */
Sam Ravnborg2e74a742014-05-16 23:25:51 +020097void sun4m_init_IRQ(void);
98void sun4m_unmask_profile_irq(void);
99void sun4m_clear_profile_irq(int cpu);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000100
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100101/* sun4m_smp.c */
102void sun4m_cpu_pre_starting(void *arg);
103void sun4m_cpu_pre_online(void *arg);
Sam Ravnborgb8417de2014-04-21 21:39:42 +0200104void __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);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100109
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000110/* sun4d_irq.c */
111extern spinlock_t sun4d_imsk_lock;
112
Sam Ravnborg2e74a742014-05-16 23:25:51 +0200113void 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);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000121
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100122/* sun4d_smp.c */
123void sun4d_cpu_pre_starting(void *arg);
124void sun4d_cpu_pre_online(void *arg);
Sam Ravnborg65199b02014-04-21 21:39:43 +0200125void __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);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100130
131/* leon_smp.c */
132void leon_cpu_pre_starting(void *arg);
133void leon_cpu_pre_online(void *arg);
Sam Ravnborg1bbc9062014-04-21 21:39:44 +0200134void leonsmp_ipi_interrupt(void);
135void leon_cross_call_irq(void);
Sam Ravnborgf9fd3482013-02-15 15:52:06 +0100136
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000137/* head_32.S */
138extern unsigned int t_nmi[];
139extern unsigned int linux_trap_ipi15_sun4d[];
140extern unsigned int linux_trap_ipi15_sun4m[];
141
Sam Ravnborg3c46e2d2016-04-22 19:41:05 +0200142extern struct tt_entry trapbase;
Sam Ravnborga2a211c2011-02-25 22:59:20 -0800143extern struct tt_entry trapbase_cpu1;
144extern struct tt_entry trapbase_cpu2;
145extern struct tt_entry trapbase_cpu3;
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000146
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
Sam Ravnborg2e74a742014-05-16 23:25:51 +0200155void floppy_hardint(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000156
157/* trampoline_32.S */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +0000158extern unsigned long sun4m_cpu_startup;
159extern unsigned long sun4d_cpu_startup;
Sam Ravnborg81265fd2008-12-08 01:08:24 -0800160
Sam Ravnborg529b17a2014-04-21 21:39:26 +0200161/* 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);
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200169
Sam Ravnborgc8c87822014-04-21 21:39:37 +0200170/* ptrace_32.c */
171asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
172
Sam Ravnborg9edfae32014-04-21 21:39:38 +0200173/* 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
Sam Ravnborg7c8ee362014-04-21 21:39:29 +0200177/* windows.c */
178void try_to_clear_window_buffer(struct pt_regs *regs, int who);
179
Sam Ravnborga3ee8fa2014-04-21 21:39:35 +0200180/* auxio_32.c */
181void __init auxio_probe(void);
182void __init auxio_power_probe(void);
183
Sam Ravnborg77389252014-05-16 23:25:42 +0200184/* pcic.c */
185extern void __iomem *pcic_regs;
186void pcic_nmi(unsigned int pend, struct pt_regs *regs);
187
Sam Ravnborgfcea8b22014-05-16 23:25:44 +0200188/* time_32.c */
189void __init time_init(void);
190
Sam Ravnborg8d74e322008-12-08 01:04:59 -0800191#else /* CONFIG_SPARC32 */
Sam Ravnborg7105de82008-12-08 01:07:47 -0800192#endif /* CONFIG_SPARC32 */
193#endif /* !(__SPARC_KERNEL_H) */