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 */ |
| 30 | void sparc32_start_kernel(struct linux_romvec *rp); |
| 31 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 32 | /* cpu.c */ |
Sam Ravnborg | 53ae341 | 2008-12-07 00:02:08 -0800 | [diff] [blame] | 33 | extern void cpu_probe(void); |
| 34 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 35 | /* traps_32.c */ |
| 36 | extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, |
| 37 | unsigned long npc, unsigned long psr); |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 38 | /* irq_32.c */ |
| 39 | extern struct irqaction static_irqaction[]; |
| 40 | extern int static_irq_count; |
| 41 | extern spinlock_t irq_action_lock; |
| 42 | |
| 43 | 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] | 44 | extern void init_IRQ(void); |
| 45 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 46 | /* sun4m_irq.c */ |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 47 | extern void sun4m_init_IRQ(void); |
Sam Ravnborg | 6baa9b2 | 2011-04-18 11:25:44 +0000 | [diff] [blame] | 48 | extern void sun4m_unmask_profile_irq(void); |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 49 | extern void sun4m_clear_profile_irq(int cpu); |
| 50 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame^] | 51 | /* sun4m_smp.c */ |
| 52 | void sun4m_cpu_pre_starting(void *arg); |
| 53 | void sun4m_cpu_pre_online(void *arg); |
| 54 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 55 | /* sun4d_irq.c */ |
| 56 | extern spinlock_t sun4d_imsk_lock; |
| 57 | |
| 58 | extern void sun4d_init_IRQ(void); |
| 59 | extern int sun4d_request_irq(unsigned int irq, |
| 60 | irq_handler_t handler, |
| 61 | unsigned long irqflags, |
| 62 | const char *devname, void *dev_id); |
| 63 | extern int show_sun4d_interrupts(struct seq_file *, void *); |
| 64 | extern void sun4d_distribute_irqs(void); |
| 65 | extern void sun4d_free_irq(unsigned int irq, void *dev_id); |
| 66 | |
Sam Ravnborg | f9fd348 | 2013-02-15 15:52:06 +0100 | [diff] [blame^] | 67 | /* sun4d_smp.c */ |
| 68 | void sun4d_cpu_pre_starting(void *arg); |
| 69 | void sun4d_cpu_pre_online(void *arg); |
| 70 | |
| 71 | /* leon_smp.c */ |
| 72 | void leon_cpu_pre_starting(void *arg); |
| 73 | void leon_cpu_pre_online(void *arg); |
| 74 | |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 75 | /* head_32.S */ |
| 76 | extern unsigned int t_nmi[]; |
| 77 | extern unsigned int linux_trap_ipi15_sun4d[]; |
| 78 | extern unsigned int linux_trap_ipi15_sun4m[]; |
| 79 | |
Sam Ravnborg | a2a211c | 2011-02-25 22:59:20 -0800 | [diff] [blame] | 80 | extern struct tt_entry trapbase_cpu1; |
| 81 | extern struct tt_entry trapbase_cpu2; |
| 82 | extern struct tt_entry trapbase_cpu3; |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 83 | |
| 84 | extern char cputypval[]; |
| 85 | |
| 86 | /* entry.S */ |
| 87 | extern unsigned long lvl14_save[4]; |
| 88 | extern unsigned int real_irq_entry[]; |
| 89 | extern unsigned int smp4d_ticker[]; |
| 90 | extern unsigned int patchme_maybe_smp_msg[]; |
| 91 | |
| 92 | extern void floppy_hardint(void); |
| 93 | |
| 94 | /* trampoline_32.S */ |
Sam Ravnborg | b7afdb7 | 2011-01-28 22:08:18 +0000 | [diff] [blame] | 95 | extern unsigned long sun4m_cpu_startup; |
| 96 | extern unsigned long sun4d_cpu_startup; |
Sam Ravnborg | 81265fd | 2008-12-08 01:08:24 -0800 | [diff] [blame] | 97 | |
Sam Ravnborg | 8d74e32 | 2008-12-08 01:04:59 -0800 | [diff] [blame] | 98 | #else /* CONFIG_SPARC32 */ |
Sam Ravnborg | 7105de8 | 2008-12-08 01:07:47 -0800 | [diff] [blame] | 99 | #endif /* CONFIG_SPARC32 */ |
| 100 | #endif /* !(__SPARC_KERNEL_H) */ |