Sam Ravnborg | 7105de8 | 2008-12-08 01:07:47 -0800 | [diff] [blame] | 1 | #ifndef __SPARC_KERNEL_H |
| 2 | #define __SPARC_KERNEL_H |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 3 | |
| 4 | #include <linux/interrupt.h> |
| 5 | |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 6 | #include <asm/traps.h> |
David S. Miller | ea5e744 | 2011-08-01 23:27:17 -0700 | [diff] [blame] | 7 | #include <asm/head.h> |
| 8 | #include <asm/io.h> |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 9 | |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 10 | /* cpu.c */ |
David S. Miller | c3cf5e8 | 2009-01-21 23:16:40 -0800 | [diff] [blame] | 11 | extern const char *sparc_pmu_type; |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 12 | extern unsigned int fsr_storage; |
Sam Ravnborg | cb1b820 | 2011-04-21 15:45:45 -0700 | [diff] [blame] | 13 | extern int ncpus_probed; |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 14 | |
David S. Miller | ac85fe8 | 2011-07-28 23:31:26 -0700 | [diff] [blame] | 15 | #ifdef CONFIG_SPARC64 |
| 16 | /* setup_64.c */ |
| 17 | struct seq_file; |
| 18 | extern void cpucap_info(struct seq_file *); |
David S. Miller | ea5e744 | 2011-08-01 23:27:17 -0700 | [diff] [blame] | 19 | |
| 20 | static inline unsigned long kimage_addr_to_ra(const char *p) |
| 21 | { |
| 22 | unsigned long val = (unsigned long) p; |
| 23 | |
| 24 | return kern_base + (val - KERNBASE); |
| 25 | } |
David S. Miller | ac85fe8 | 2011-07-28 23:31:26 -0700 | [diff] [blame] | 26 | #endif |
| 27 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 28 | #ifdef CONFIG_SPARC32 |
Sam Ravnborg | 4efb55e | 2012-05-25 21:20:08 +0000 | [diff] [blame] | 29 | /* setup_32.c */ |
Sam Ravnborg | 178f0ff | 2014-05-16 23:25:39 +0200 | [diff] [blame] | 30 | struct linux_romvec; |
Sam Ravnborg | 4efb55e | 2012-05-25 21:20:08 +0000 | [diff] [blame] | 31 | void sparc32_start_kernel(struct linux_romvec *rp); |
| 32 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 33 | /* cpu.c */ |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 34 | extern void cpu_probe(void); |
| 35 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 36 | /* traps_32.c */ |
| 37 | extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, |
| 38 | unsigned long npc, unsigned long psr); |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 39 | /* irq_32.c */ |
| 40 | extern struct irqaction static_irqaction[]; |
| 41 | extern int static_irq_count; |
| 42 | extern spinlock_t irq_action_lock; |
| 43 | |
| 44 | extern void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 45 | extern void init_IRQ(void); |
| 46 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 47 | /* sun4m_irq.c */ |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 48 | extern void sun4m_init_IRQ(void); |
Sam Ravnborg | 6baa9b2 | 2011-04-18 11:25:44 +0000 | [diff] [blame] | 49 | extern void sun4m_unmask_profile_irq(void); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 50 | extern void sun4m_clear_profile_irq(int cpu); |
| 51 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 52 | /* sun4m_smp.c */ |
| 53 | void sun4m_cpu_pre_starting(void *arg); |
| 54 | void sun4m_cpu_pre_online(void *arg); |
Sam Ravnborg | b8417de | 2014-04-21 21:39:42 +0200 | [diff] [blame] | 55 | void __init smp4m_boot_cpus(void); |
| 56 | int smp4m_boot_one_cpu(int i, struct task_struct *idle); |
| 57 | void __init smp4m_smp_done(void); |
| 58 | void smp4m_cross_call_irq(void); |
| 59 | void smp4m_percpu_timer_interrupt(struct pt_regs *regs); |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 60 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 61 | /* sun4d_irq.c */ |
| 62 | extern spinlock_t sun4d_imsk_lock; |
| 63 | |
| 64 | extern void sun4d_init_IRQ(void); |
| 65 | extern int sun4d_request_irq(unsigned int irq, |
| 66 | irq_handler_t handler, |
| 67 | unsigned long irqflags, |
| 68 | const char *devname, void *dev_id); |
| 69 | extern int show_sun4d_interrupts(struct seq_file *, void *); |
| 70 | extern void sun4d_distribute_irqs(void); |
| 71 | extern void sun4d_free_irq(unsigned int irq, void *dev_id); |
| 72 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 73 | /* sun4d_smp.c */ |
| 74 | void sun4d_cpu_pre_starting(void *arg); |
| 75 | void sun4d_cpu_pre_online(void *arg); |
Sam Ravnborg | 65199b0 | 2014-04-21 21:39:43 +0200 | [diff] [blame] | 76 | void __init smp4d_boot_cpus(void); |
| 77 | int smp4d_boot_one_cpu(int i, struct task_struct *idle); |
| 78 | void __init smp4d_smp_done(void); |
| 79 | void smp4d_cross_call_irq(void); |
| 80 | void smp4d_percpu_timer_interrupt(struct pt_regs *regs); |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 81 | |
| 82 | /* leon_smp.c */ |
| 83 | void leon_cpu_pre_starting(void *arg); |
| 84 | void leon_cpu_pre_online(void *arg); |
Sam Ravnborg | 1bbc906 | 2014-04-21 21:39:44 +0200 | [diff] [blame] | 85 | void leonsmp_ipi_interrupt(void); |
| 86 | void leon_cross_call_irq(void); |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame] | 87 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 88 | /* head_32.S */ |
| 89 | extern unsigned int t_nmi[]; |
| 90 | extern unsigned int linux_trap_ipi15_sun4d[]; |
| 91 | extern unsigned int linux_trap_ipi15_sun4m[]; |
| 92 | |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 93 | extern struct tt_entry trapbase_cpu1; |
| 94 | extern struct tt_entry trapbase_cpu2; |
| 95 | extern struct tt_entry trapbase_cpu3; |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 96 | |
| 97 | extern char cputypval[]; |
| 98 | |
| 99 | /* entry.S */ |
| 100 | extern unsigned long lvl14_save[4]; |
| 101 | extern unsigned int real_irq_entry[]; |
| 102 | extern unsigned int smp4d_ticker[]; |
| 103 | extern unsigned int patchme_maybe_smp_msg[]; |
| 104 | |
| 105 | extern void floppy_hardint(void); |
| 106 | |
| 107 | /* trampoline_32.S */ |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 108 | extern unsigned long sun4m_cpu_startup; |
| 109 | extern unsigned long sun4d_cpu_startup; |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 110 | |
Sam Ravnborg | 8bdd5a1 | 2014-04-21 21:39:25 +0200 | [diff] [blame] | 111 | /* process_32.c */ |
| 112 | asmlinkage int sparc_do_fork(unsigned long clone_flags, |
| 113 | unsigned long stack_start, |
| 114 | struct pt_regs *regs, |
| 115 | unsigned long stack_size); |
| 116 | |
Sam Ravnborg | 529b17a | 2014-04-21 21:39:26 +0200 | [diff] [blame] | 117 | /* signal_32.c */ |
| 118 | asmlinkage void do_sigreturn(struct pt_regs *regs); |
| 119 | asmlinkage void do_rt_sigreturn(struct pt_regs *regs); |
| 120 | void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, |
| 121 | unsigned long thread_info_flags); |
| 122 | asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr, |
| 123 | struct sigstack __user *ossptr, |
| 124 | unsigned long sp); |
Sam Ravnborg | 7c8ee36 | 2014-04-21 21:39:29 +0200 | [diff] [blame] | 125 | |
Sam Ravnborg | c8c8782 | 2014-04-21 21:39:37 +0200 | [diff] [blame] | 126 | /* ptrace_32.c */ |
| 127 | asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); |
| 128 | |
Sam Ravnborg | 9edfae3 | 2014-04-21 21:39:38 +0200 | [diff] [blame] | 129 | /* unaligned_32.c */ |
| 130 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn); |
| 131 | asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn); |
| 132 | |
Sam Ravnborg | 7c8ee36 | 2014-04-21 21:39:29 +0200 | [diff] [blame] | 133 | /* windows.c */ |
| 134 | void try_to_clear_window_buffer(struct pt_regs *regs, int who); |
| 135 | |
Sam Ravnborg | 6b5f02f | 2014-04-21 21:39:32 +0200 | [diff] [blame] | 136 | /* tadpole.c */ |
| 137 | void __init clock_stop_probe(void); |
| 138 | |
Sam Ravnborg | a3ee8fa | 2014-04-21 21:39:35 +0200 | [diff] [blame] | 139 | /* auxio_32.c */ |
| 140 | void __init auxio_probe(void); |
| 141 | void __init auxio_power_probe(void); |
| 142 | |
Sam Ravnborg | 7738925 | 2014-05-16 23:25:42 +0200 | [diff] [blame^] | 143 | /* pcic.c */ |
| 144 | extern void __iomem *pcic_regs; |
| 145 | void pcic_nmi(unsigned int pend, struct pt_regs *regs); |
| 146 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 147 | #else /* CONFIG_SPARC32 */ |
Sam Ravnborg | 7105de8 | 2008-12-08 01:07:47 -0800 | [diff] [blame] | 148 | #endif /* CONFIG_SPARC32 */ |
| 149 | #endif /* !(__SPARC_KERNEL_H) */ |