blob: a702d9ab019c23e13bfdaa681ebf40f625adb6c1 [file] [log] [blame]
Sam Ravnborg7105de82008-12-08 01:07:47 -08001#ifndef __SPARC_KERNEL_H
2#define __SPARC_KERNEL_H
Sam Ravnborg81265fd2008-12-08 01:08:24 -08003
4#include <linux/interrupt.h>
5
Sam Ravnborga2a211c2011-02-25 22:59:20 -08006#include <asm/traps.h>
David S. Millerea5e7442011-08-01 23:27:17 -07007#include <asm/head.h>
8#include <asm/io.h>
Sam Ravnborga2a211c2011-02-25 22:59:20 -08009
Sam Ravnborg53ae3412008-12-07 00:02:08 -080010/* cpu.c */
David S. Millerc3cf5e82009-01-21 23:16:40 -080011extern const char *sparc_pmu_type;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080012extern unsigned int fsr_storage;
Sam Ravnborgcb1b8202011-04-21 15:45:45 -070013extern int ncpus_probed;
Sam Ravnborg53ae3412008-12-07 00:02:08 -080014
David S. Millerac85fe82011-07-28 23:31:26 -070015#ifdef CONFIG_SPARC64
16/* setup_64.c */
17struct seq_file;
18extern void cpucap_info(struct seq_file *);
David S. Millerea5e7442011-08-01 23:27:17 -070019
20static 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. Millerac85fe82011-07-28 23:31:26 -070026#endif
27
Sam Ravnborg8d74e322008-12-08 01:04:59 -080028#ifdef CONFIG_SPARC32
Sam Ravnborg4efb55e2012-05-25 21:20:08 +000029/* setup_32.c */
30void sparc32_start_kernel(struct linux_romvec *rp);
31
Sam Ravnborg8d74e322008-12-08 01:04:59 -080032/* cpu.c */
Sam Ravnborg53ae3412008-12-07 00:02:08 -080033extern void cpu_probe(void);
34
Sam Ravnborg8d74e322008-12-08 01:04:59 -080035/* traps_32.c */
36extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
37 unsigned long npc, unsigned long psr);
Sam Ravnborg81265fd2008-12-08 01:08:24 -080038/* irq_32.c */
39extern struct irqaction static_irqaction[];
40extern int static_irq_count;
41extern spinlock_t irq_action_lock;
42
43extern void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000044extern void init_IRQ(void);
45
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000046/* sun4m_irq.c */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000047extern void sun4m_init_IRQ(void);
Sam Ravnborg6baa9b22011-04-18 11:25:44 +000048extern void sun4m_unmask_profile_irq(void);
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000049extern void sun4m_clear_profile_irq(int cpu);
50
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010051/* sun4m_smp.c */
52void sun4m_cpu_pre_starting(void *arg);
53void sun4m_cpu_pre_online(void *arg);
54
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000055/* sun4d_irq.c */
56extern spinlock_t sun4d_imsk_lock;
57
58extern void sun4d_init_IRQ(void);
59extern int sun4d_request_irq(unsigned int irq,
60 irq_handler_t handler,
61 unsigned long irqflags,
62 const char *devname, void *dev_id);
63extern int show_sun4d_interrupts(struct seq_file *, void *);
64extern void sun4d_distribute_irqs(void);
65extern void sun4d_free_irq(unsigned int irq, void *dev_id);
66
Sam Ravnborgf9fd3482013-02-15 15:52:06 +010067/* sun4d_smp.c */
68void sun4d_cpu_pre_starting(void *arg);
69void sun4d_cpu_pre_online(void *arg);
70
71/* leon_smp.c */
72void leon_cpu_pre_starting(void *arg);
73void leon_cpu_pre_online(void *arg);
74
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000075/* head_32.S */
76extern unsigned int t_nmi[];
77extern unsigned int linux_trap_ipi15_sun4d[];
78extern unsigned int linux_trap_ipi15_sun4m[];
79
Sam Ravnborga2a211c2011-02-25 22:59:20 -080080extern struct tt_entry trapbase_cpu1;
81extern struct tt_entry trapbase_cpu2;
82extern struct tt_entry trapbase_cpu3;
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000083
84extern char cputypval[];
85
86/* entry.S */
87extern unsigned long lvl14_save[4];
88extern unsigned int real_irq_entry[];
89extern unsigned int smp4d_ticker[];
90extern unsigned int patchme_maybe_smp_msg[];
91
92extern void floppy_hardint(void);
93
94/* trampoline_32.S */
Sam Ravnborgb7afdb72011-01-28 22:08:18 +000095extern unsigned long sun4m_cpu_startup;
96extern unsigned long sun4d_cpu_startup;
Sam Ravnborg81265fd2008-12-08 01:08:24 -080097
Sam Ravnborg8d74e322008-12-08 01:04:59 -080098#else /* CONFIG_SPARC32 */
Sam Ravnborg7105de82008-12-08 01:07:47 -080099#endif /* CONFIG_SPARC32 */
100#endif /* !(__SPARC_KERNEL_H) */