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