xref: /openbmc/linux/arch/sparc/kernel/kernel.h (revision c8c8782d)
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 /* setup_32.c */
30 void sparc32_start_kernel(struct linux_romvec *rp);
31 
32 /* cpu.c */
33 extern void cpu_probe(void);
34 
35 /* traps_32.c */
36 extern void handle_hw_divzero(struct pt_regs *regs, unsigned long pc,
37                               unsigned long npc, unsigned long psr);
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);
44 extern void init_IRQ(void);
45 
46 /* sun4m_irq.c */
47 extern void sun4m_init_IRQ(void);
48 extern void sun4m_unmask_profile_irq(void);
49 extern void sun4m_clear_profile_irq(int cpu);
50 
51 /* sun4m_smp.c */
52 void sun4m_cpu_pre_starting(void *arg);
53 void sun4m_cpu_pre_online(void *arg);
54 
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 
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 
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 
80 extern struct tt_entry trapbase_cpu1;
81 extern struct tt_entry trapbase_cpu2;
82 extern struct tt_entry trapbase_cpu3;
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 */
95 extern unsigned long sun4m_cpu_startup;
96 extern unsigned long sun4d_cpu_startup;
97 
98 /* process_32.c */
99 asmlinkage int sparc_do_fork(unsigned long clone_flags,
100                              unsigned long stack_start,
101                              struct pt_regs *regs,
102                              unsigned long stack_size);
103 
104 /* signal_32.c */
105 asmlinkage void do_sigreturn(struct pt_regs *regs);
106 asmlinkage void do_rt_sigreturn(struct pt_regs *regs);
107 void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
108                       unsigned long thread_info_flags);
109 asmlinkage int do_sys_sigstack(struct sigstack __user *ssptr,
110                                struct sigstack __user *ossptr,
111                                unsigned long sp);
112 
113 /* ptrace_32.c */
114 asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p);
115 
116 /* windows.c */
117 void try_to_clear_window_buffer(struct pt_regs *regs, int who);
118 
119 /* tadpole.c */
120 void __init clock_stop_probe(void);
121 
122 /* auxio_32.c */
123 void __init auxio_probe(void);
124 void __init auxio_power_probe(void);
125 
126 #else /* CONFIG_SPARC32 */
127 #endif /* CONFIG_SPARC32 */
128 #endif /* !(__SPARC_KERNEL_H) */
129