Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Sam Ravnborg | 7105de8 | 2008-12-08 01:07:47 -0800 | [diff] [blame] | 2 | #ifndef __SPARC_KERNEL_H |
| 3 | #define __SPARC_KERNEL_H |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 4 | |
| 5 | #include <linux/interrupt.h> |
Sam Ravnborg | a0c54a2 | 2014-05-16 23:25:57 +0200 | [diff] [blame] | 6 | #include <linux/ftrace.h> |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 7 | |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 8 | #include <asm/traps.h> |
David S. Miller | ea5e744 | 2011-08-01 23:27:17 -0700 | [diff] [blame] | 9 | #include <asm/head.h> |
| 10 | #include <asm/io.h> |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 11 | |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 12 | /* cpu.c */ |
David S. Miller | c3cf5e8 | 2009-01-21 23:16:40 -0800 | [diff] [blame] | 13 | extern const char *sparc_pmu_type; |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 14 | extern unsigned int fsr_storage; |
Sam Ravnborg | cb1b820 | 2011-04-21 15:45:45 -0700 | [diff] [blame] | 15 | extern int ncpus_probed; |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 16 | |
Christian Brauner | a4261d4 | 2020-05-12 19:15:26 +0200 | [diff] [blame] | 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 | |
David S. Miller | ac85fe8 | 2011-07-28 23:31:26 -0700 | [diff] [blame] | 22 | #ifdef CONFIG_SPARC64 |
| 23 | /* setup_64.c */ |
| 24 | struct seq_file; |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 25 | void cpucap_info(struct seq_file *); |
David S. Miller | ea5e744 | 2011-08-01 23:27:17 -0700 | [diff] [blame] | 26 | |
Sam Ravnborg | a0c54a2 | 2014-05-16 23:25:57 +0200 | [diff] [blame] | 27 | static inline unsigned long kimage_addr_to_ra(const void *p) |
David S. Miller | ea5e744 | 2011-08-01 23:27:17 -0700 | [diff] [blame] | 28 | { |
| 29 | unsigned long val = (unsigned long) p; |
| 30 | |
| 31 | return kern_base + (val - KERNBASE); |
| 32 | } |
Sam Ravnborg | 8df5262 | 2014-05-16 23:25:54 +0200 | [diff] [blame] | 33 | |
| 34 | /* sys_sparc_64.c */ |
| 35 | asmlinkage long sys_kern_features(void); |
| 36 | |
| 37 | /* unaligned_64.c */ |
| 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); |
| 42 | |
Sam Ravnborg | a0c54a2 | 2014-05-16 23:25:57 +0200 | [diff] [blame] | 43 | /* smp_64.c */ |
| 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); |
Sam Ravnborg | a0c54a2 | 2014-05-16 23:25:57 +0200 | [diff] [blame] | 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); |
| 48 | |
Sam Ravnborg | 48c7eca | 2014-05-16 23:26:09 +0200 | [diff] [blame] | 49 | /* kgdb_64.c */ |
| 50 | void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs); |
| 51 | |
Sam Ravnborg | 4ac7b82 | 2014-05-16 23:25:58 +0200 | [diff] [blame] | 52 | /* pci.c */ |
Christoph Hellwig | c54fc98 | 2019-02-15 09:06:31 +0100 | [diff] [blame] | 53 | #ifdef CONFIG_PCI |
| 54 | int ali_sound_dma_hack(struct device *dev, u64 device_mask); |
| 55 | #else |
| 56 | #define ali_sound_dma_hack(dev, mask) (0) |
| 57 | #endif |
Sam Ravnborg | 4ac7b82 | 2014-05-16 23:25:58 +0200 | [diff] [blame] | 58 | |
Sam Ravnborg | abaff45 | 2014-05-16 23:26:00 +0200 | [diff] [blame] | 59 | /* signal32.c */ |
| 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); |
| 64 | |
Pavel Tatashin | 83e8eb9 | 2017-06-12 16:41:46 -0400 | [diff] [blame] | 65 | /* time_64.c */ |
| 66 | void __init time_init_early(void); |
| 67 | |
Sam Ravnborg | a1ca187 | 2014-05-16 23:26:08 +0200 | [diff] [blame] | 68 | /* compat_audit.c */ |
Joe Perches | 9ef595d | 2016-03-10 15:21:43 -0800 | [diff] [blame] | 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); |
David S. Miller | ac85fe8 | 2011-07-28 23:31:26 -0700 | [diff] [blame] | 75 | #endif |
| 76 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 77 | #ifdef CONFIG_SPARC32 |
Sam Ravnborg | 4efb55e | 2012-05-25 21:20:08 +0000 | [diff] [blame] | 78 | /* setup_32.c */ |
Sam Ravnborg | 178f0ff | 2014-05-16 23:25:39 +0200 | [diff] [blame] | 79 | struct linux_romvec; |
Sam Ravnborg | 4efb55e | 2012-05-25 21:20:08 +0000 | [diff] [blame] | 80 | void sparc32_start_kernel(struct linux_romvec *rp); |
| 81 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 82 | /* cpu.c */ |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 83 | void cpu_probe(void); |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 84 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 85 | /* traps_32.c */ |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 86 | void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, |
| 87 | unsigned long npc, unsigned long psr); |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 88 | /* irq_32.c */ |
| 89 | extern struct irqaction static_irqaction[]; |
| 90 | extern int static_irq_count; |
| 91 | extern spinlock_t irq_action_lock; |
| 92 | |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 93 | void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); |
| 94 | void init_IRQ(void); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 95 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 96 | /* sun4m_irq.c */ |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 97 | void sun4m_init_IRQ(void); |
| 98 | void sun4m_unmask_profile_irq(void); |
| 99 | void sun4m_clear_profile_irq(int cpu); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 100 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 101 | /* sun4m_smp.c */ |
| 102 | void sun4m_cpu_pre_starting(void *arg); |
| 103 | void sun4m_cpu_pre_online(void *arg); |
Sam Ravnborg | b8417de | 2014-04-21 21:39:42 +0200 | [diff] [blame] | 104 | void __init smp4m_boot_cpus(void); |
| 105 | int smp4m_boot_one_cpu(int i, struct task_struct *idle); |
| 106 | void __init smp4m_smp_done(void); |
| 107 | void smp4m_cross_call_irq(void); |
| 108 | void smp4m_percpu_timer_interrupt(struct pt_regs *regs); |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 109 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 110 | /* sun4d_irq.c */ |
| 111 | extern spinlock_t sun4d_imsk_lock; |
| 112 | |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 113 | void sun4d_init_IRQ(void); |
| 114 | int sun4d_request_irq(unsigned int irq, |
| 115 | irq_handler_t handler, |
| 116 | unsigned long irqflags, |
| 117 | const char *devname, void *dev_id); |
| 118 | int show_sun4d_interrupts(struct seq_file *, void *); |
| 119 | void sun4d_distribute_irqs(void); |
| 120 | void sun4d_free_irq(unsigned int irq, void *dev_id); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 121 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 122 | /* sun4d_smp.c */ |
| 123 | void sun4d_cpu_pre_starting(void *arg); |
| 124 | void sun4d_cpu_pre_online(void *arg); |
Sam Ravnborg | 65199b0 | 2014-04-21 21:39:43 +0200 | [diff] [blame] | 125 | void __init smp4d_boot_cpus(void); |
| 126 | int smp4d_boot_one_cpu(int i, struct task_struct *idle); |
| 127 | void __init smp4d_smp_done(void); |
| 128 | void smp4d_cross_call_irq(void); |
| 129 | void smp4d_percpu_timer_interrupt(struct pt_regs *regs); |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 130 | |
| 131 | /* leon_smp.c */ |
| 132 | void leon_cpu_pre_starting(void *arg); |
| 133 | void leon_cpu_pre_online(void *arg); |
Sam Ravnborg | 1bbc906 | 2014-04-21 21:39:44 +0200 | [diff] [blame] | 134 | void leonsmp_ipi_interrupt(void); |
| 135 | void leon_cross_call_irq(void); |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 136 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 137 | /* head_32.S */ |
| 138 | extern unsigned int t_nmi[]; |
| 139 | extern unsigned int linux_trap_ipi15_sun4d[]; |
| 140 | extern unsigned int linux_trap_ipi15_sun4m[]; |
| 141 | |
Sam Ravnborg | 3c46e2d | 2016-04-22 19:41:05 +0200 | [diff] [blame] | 142 | extern struct tt_entry trapbase; |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 143 | extern struct tt_entry trapbase_cpu1; |
| 144 | extern struct tt_entry trapbase_cpu2; |
| 145 | extern struct tt_entry trapbase_cpu3; |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 146 | |
| 147 | extern char cputypval[]; |
| 148 | |
| 149 | /* entry.S */ |
| 150 | extern unsigned long lvl14_save[4]; |
| 151 | extern unsigned int real_irq_entry[]; |
| 152 | extern unsigned int smp4d_ticker[]; |
| 153 | extern unsigned int patchme_maybe_smp_msg[]; |
| 154 | |
Sam Ravnborg | 2e74a74 | 2014-05-16 23:25:51 +0200 | [diff] [blame] | 155 | void floppy_hardint(void); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 156 | |
| 157 | /* trampoline_32.S */ |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 158 | extern unsigned long sun4m_cpu_startup; |
| 159 | extern unsigned long sun4d_cpu_startup; |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 160 | |
Sam Ravnborg | 529b17a | 2014-04-21 21:39:26 +0200 | [diff] [blame] | 161 | /* signal_32.c */ |
| 162 | asmlinkage void do_sigreturn(struct pt_regs *regs); |
| 163 | asmlinkage void do_rt_sigreturn(struct pt_regs *regs); |
| 164 | void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, |
| 165 | unsigned long thread_info_flags); |
| 166 | asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, |
| 167 | struct sigstack __user *ossptr, |
| 168 | unsigned long sp); |
Sam Ravnborg | 7c8ee36 | 2014-04-21 21:39:29 +0200 | [diff] [blame] | 169 | |
Sam Ravnborg | c8c8782 | 2014-04-21 21:39:37 +0200 | [diff] [blame] | 170 | /* ptrace_32.c */ |
| 171 | asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); |
| 172 | |
Sam Ravnborg | 9edfae3 | 2014-04-21 21:39:38 +0200 | [diff] [blame] | 173 | /* unaligned_32.c */ |
| 174 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); |
| 175 | asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); |
| 176 | |
Sam Ravnborg | 7c8ee36 | 2014-04-21 21:39:29 +0200 | [diff] [blame] | 177 | /* windows.c */ |
| 178 | void try_to_clear_window_buffer(struct pt_regs *regs, int who); |
| 179 | |
Sam Ravnborg | a3ee8fa | 2014-04-21 21:39:35 +0200 | [diff] [blame] | 180 | /* auxio_32.c */ |
| 181 | void __init auxio_probe(void); |
| 182 | void __init auxio_power_probe(void); |
| 183 | |
Sam Ravnborg | 7738925 | 2014-05-16 23:25:42 +0200 | [diff] [blame] | 184 | /* pcic.c */ |
| 185 | extern void __iomem *pcic_regs; |
| 186 | void pcic_nmi(unsigned int pend, struct pt_regs *regs); |
| 187 | |
Sam Ravnborg | fcea8b2 | 2014-05-16 23:25:44 +0200 | [diff] [blame] | 188 | /* time_32.c */ |
| 189 | void __init time_init(void); |
| 190 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 191 | #else /* CONFIG_SPARC32 */ |
Sam Ravnborg | 7105de8 | 2008-12-08 01:07:47 -0800 | [diff] [blame] | 192 | #endif /* CONFIG_SPARC32 */ |
| 193 | #endif /* !(__SPARC_KERNEL_H) */ |