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