xref: /openbmc/linux/arch/alpha/kernel/proto.h (revision b46f7d33)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/interrupt.h>
3 #include <linux/io.h>
4 
5 /* Prototypes of functions used across modules here in this directory.  */
6 
7 #define vucp	volatile unsigned char  *
8 #define vusp	volatile unsigned short *
9 #define vip	volatile int *
10 #define vuip	volatile unsigned int   *
11 #define vulp	volatile unsigned long  *
12 
13 struct pt_regs;
14 struct task_struct;
15 struct pci_dev;
16 struct pci_controller;
17 
18 /* core_apecs.c */
19 extern struct pci_ops apecs_pci_ops;
20 extern void apecs_init_arch(void);
21 extern void apecs_pci_clr_err(void);
22 extern void apecs_machine_check(unsigned long vector, unsigned long la_ptr);
23 extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
24 
25 /* core_cia.c */
26 extern struct pci_ops cia_pci_ops;
27 extern void cia_init_pci(void);
28 extern void cia_init_arch(void);
29 extern void pyxis_init_arch(void);
30 extern void cia_kill_arch(int);
31 extern void cia_machine_check(unsigned long vector, unsigned long la_ptr);
32 extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
33 
34 /* core_irongate.c */
35 extern struct pci_ops irongate_pci_ops;
36 extern int irongate_pci_clr_err(void);
37 extern void irongate_init_arch(void);
38 #define irongate_pci_tbi ((void *)0)
39 
40 /* core_lca.c */
41 extern struct pci_ops lca_pci_ops;
42 extern void lca_init_arch(void);
43 extern void lca_machine_check(unsigned long vector, unsigned long la_ptr);
44 extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
45 
46 /* core_marvel.c */
47 extern struct pci_ops marvel_pci_ops;
48 extern void marvel_init_arch(void);
49 extern void marvel_kill_arch(int);
50 extern void marvel_machine_check(unsigned long, unsigned long);
51 extern void marvel_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
52 extern struct _alpha_agp_info *marvel_agp_info(void);
53 struct io7 *marvel_find_io7(int pe);
54 struct io7 *marvel_next_io7(struct io7 *prev);
55 void io7_clear_errors(struct io7 *io7);
56 
57 /* core_mcpcia.c */
58 extern struct pci_ops mcpcia_pci_ops;
59 extern void mcpcia_init_arch(void);
60 extern void mcpcia_init_hoses(void);
61 extern void mcpcia_machine_check(unsigned long vector, unsigned long la_ptr);
62 extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
63 
64 /* core_polaris.c */
65 extern struct pci_ops polaris_pci_ops;
66 extern int polaris_read_config_dword(struct pci_dev *, int, u32 *);
67 extern int polaris_write_config_dword(struct pci_dev *, int, u32);
68 extern void polaris_init_arch(void);
69 extern void polaris_machine_check(unsigned long vector, unsigned long la_ptr);
70 #define polaris_pci_tbi ((void *)0)
71 
72 /* core_t2.c */
73 extern struct pci_ops t2_pci_ops;
74 extern void t2_init_arch(void);
75 extern void t2_kill_arch(int);
76 extern void t2_machine_check(unsigned long vector, unsigned long la_ptr);
77 extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
78 
79 /* core_titan.c */
80 extern struct pci_ops titan_pci_ops;
81 extern void titan_init_arch(void);
82 extern void titan_kill_arch(int);
83 extern void titan_machine_check(unsigned long, unsigned long);
84 extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
85 extern struct _alpha_agp_info *titan_agp_info(void);
86 
87 /* core_tsunami.c */
88 extern struct pci_ops tsunami_pci_ops;
89 extern void tsunami_init_arch(void);
90 extern void tsunami_kill_arch(int);
91 extern void tsunami_machine_check(unsigned long vector, unsigned long la_ptr);
92 extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
93 
94 /* core_wildfire.c */
95 extern struct pci_ops wildfire_pci_ops;
96 extern void wildfire_init_arch(void);
97 extern void wildfire_kill_arch(int);
98 extern void wildfire_machine_check(unsigned long vector, unsigned long la_ptr);
99 extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
100 
101 /* console.c */
102 #ifdef CONFIG_VGA_HOSE
103 extern void find_console_vga_hose(void);
104 extern void locate_and_init_vga(void *(*)(void *, void *));
105 #else
106 static inline void find_console_vga_hose(void) { }
107 static inline void locate_and_init_vga(void *(*sel_func)(void *, void *)) { }
108 #endif
109 
110 /* setup.c */
111 extern unsigned long srm_hae;
112 extern int boot_cpuid;
113 #ifdef CONFIG_VERBOSE_MCHECK
114 extern unsigned long alpha_verbose_mcheck;
115 #endif
116 
117 /* srmcons.c */
118 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM)
119 extern void register_srm_console(void);
120 extern void unregister_srm_console(void);
121 #else
122 #define register_srm_console()
123 #define unregister_srm_console()
124 #endif
125 
126 /* smp.c */
127 extern void setup_smp(void);
128 extern void handle_ipi(struct pt_regs *);
129 
130 /* bios32.c */
131 /* extern void reset_for_srm(void); */
132 
133 /* time.c */
134 extern irqreturn_t rtc_timer_interrupt(int irq, void *dev);
135 extern void init_clockevent(void);
136 extern void common_init_rtc(void);
137 extern unsigned long est_cycle_freq;
138 
139 /* smc37c93x.c */
140 extern void SMC93x_Init(void);
141 
142 /* smc37c669.c */
143 extern void SMC669_Init(int);
144 
145 /* es1888.c */
146 extern void es1888_init(void);
147 
148 /* ../lib/fpreg.c */
149 extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
150 extern unsigned long alpha_read_fp_reg (unsigned long reg);
151 
152 /* head.S */
153 extern void wrmces(unsigned long mces);
154 extern void cserve_ena(unsigned long);
155 extern void cserve_dis(unsigned long);
156 extern void __smp_callin(unsigned long);
157 
158 /* entry.S */
159 extern void entArith(void);
160 extern void entIF(void);
161 extern void entInt(void);
162 extern void entMM(void);
163 extern void entSys(void);
164 extern void entUna(void);
165 extern void entDbg(void);
166 
167 /* ptrace.c */
168 extern int ptrace_set_bpt (struct task_struct *child);
169 extern int ptrace_cancel_bpt (struct task_struct *child);
170 
171 /* traps.c */
172 extern void dik_show_regs(struct pt_regs *regs, unsigned long *r9_15);
173 extern void die_if_kernel(char *, struct pt_regs *, long, unsigned long *);
174 
175 /* sys_titan.c */
176 extern void titan_dispatch_irqs(u64);
177 
178 /* ../mm/init.c */
179 extern void switch_to_system_map(void);
180 extern void srm_paging_stop(void);
181 
182 static inline int
183 __alpha_remap_area_pages(unsigned long address, unsigned long phys_addr,
184 			 unsigned long size, unsigned long flags)
185 {
186 	pgprot_t prot;
187 
188 	prot = __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE
189 			| _PAGE_KWE | flags);
190 	return ioremap_page_range(address, address + size, phys_addr, prot);
191 }
192 
193 /* irq.c */
194 
195 #ifdef CONFIG_SMP
196 #define mcheck_expected(cpu)	(cpu_data[cpu].mcheck_expected)
197 #define mcheck_taken(cpu)	(cpu_data[cpu].mcheck_taken)
198 #define mcheck_extra(cpu)	(cpu_data[cpu].mcheck_extra)
199 #else
200 extern struct mcheck_info
201 {
202 	unsigned char expected __attribute__((aligned(8)));
203 	unsigned char taken;
204 	unsigned char extra;
205 } __mcheck_info;
206 
207 #define mcheck_expected(cpu)	(*((void)(cpu), &__mcheck_info.expected))
208 #define mcheck_taken(cpu)	(*((void)(cpu), &__mcheck_info.taken))
209 #define mcheck_extra(cpu)	(*((void)(cpu), &__mcheck_info.extra))
210 #endif
211 
212 extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr,
213 				const char *machine, int expected);
214