Merge branches 'fixes' and 'fixes2' into devel-late
[firefly-linux-kernel-4.4.55.git] / arch / sparc / kernel / kernel.h
1 #ifndef __SPARC_KERNEL_H
2 #define __SPARC_KERNEL_H
3
4 #include <linux/interrupt.h>
5
6 #include <asm/traps.h>
7 #include <asm/head.h>
8 #include <asm/io.h>
9
10 /* cpu.c */
11 extern const char *sparc_pmu_type;
12 extern unsigned int fsr_storage;
13 extern int ncpus_probed;
14
15 #ifdef CONFIG_SPARC64
16 /* setup_64.c */
17 struct seq_file;
18 extern void cpucap_info(struct seq_file *);
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 }
26 #endif
27
28 #ifdef CONFIG_SPARC32
29 /* cpu.c */
30 extern void cpu_probe(void);
31
32 /* traps_32.c */
33 extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
34                               unsigned long npc, unsigned long psr);
35 /* irq_32.c */
36 extern struct irqaction static_irqaction[];
37 extern int static_irq_count;
38 extern spinlock_t irq_action_lock;
39
40 extern void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs);
41 extern void init_IRQ(void);
42
43 /* sun4m_irq.c */
44 extern void sun4m_init_IRQ(void);
45 extern void sun4m_unmask_profile_irq(void);
46 extern void sun4m_clear_profile_irq(int cpu);
47
48 /* sun4d_irq.c */
49 extern spinlock_t sun4d_imsk_lock;
50
51 extern void sun4d_init_IRQ(void);
52 extern int sun4d_request_irq(unsigned int irq,
53                              irq_handler_t handler,
54                              unsigned long irqflags,
55                              const char *devname, void *dev_id);
56 extern int show_sun4d_interrupts(struct seq_file *, void *);
57 extern void sun4d_distribute_irqs(void);
58 extern void sun4d_free_irq(unsigned int irq, void *dev_id);
59
60 /* head_32.S */
61 extern unsigned int t_nmi[];
62 extern unsigned int linux_trap_ipi15_sun4d[];
63 extern unsigned int linux_trap_ipi15_sun4m[];
64
65 extern struct tt_entry trapbase_cpu1;
66 extern struct tt_entry trapbase_cpu2;
67 extern struct tt_entry trapbase_cpu3;
68
69 extern char cputypval[];
70
71 /* entry.S */
72 extern unsigned long lvl14_save[4];
73 extern unsigned int real_irq_entry[];
74 extern unsigned int smp4d_ticker[];
75 extern unsigned int patchme_maybe_smp_msg[];
76
77 extern void floppy_hardint(void);
78
79 /* trampoline_32.S */
80 extern unsigned long sun4m_cpu_startup;
81 extern unsigned long sun4d_cpu_startup;
82
83 #else /* CONFIG_SPARC32 */
84 #endif /* CONFIG_SPARC32 */
85 #endif /* !(__SPARC_KERNEL_H) */