1#ifndef _ASM_X86_PLATFORM_H
2#define _ASM_X86_PLATFORM_H
3
4#include <asm/pgtable_types.h>
5#include <asm/bootparam.h>
6
7struct mpc_bus;
8struct mpc_cpu;
9struct mpc_table;
10struct cpuinfo_x86;
11
12
13
14
15
16
17
18
19
20
21
22
23struct x86_init_mpparse {
24 void (*mpc_record)(unsigned int mode);
25 void (*setup_ioapic_ids)(void);
26 int (*mpc_apic_id)(struct mpc_cpu *m);
27 void (*smp_read_mpc_oem)(struct mpc_table *mpc);
28 void (*mpc_oem_pci_bus)(struct mpc_bus *m);
29 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
30 void (*find_smp_config)(void);
31 void (*get_smp_config)(unsigned int early);
32};
33
34
35
36
37
38
39
40
41
42struct x86_init_resources {
43 void (*probe_roms)(void);
44 void (*reserve_resources)(void);
45 char *(*memory_setup)(void);
46};
47
48
49
50
51
52
53
54
55struct x86_init_irqs {
56 void (*pre_vector_init)(void);
57 void (*intr_init)(void);
58 void (*trap_init)(void);
59};
60
61
62
63
64
65
66struct x86_init_oem {
67 void (*arch_setup)(void);
68 void (*banner)(void);
69};
70
71
72
73
74
75
76
77
78struct x86_init_mapping {
79 void (*pagetable_reserve)(u64 start, u64 end);
80};
81
82
83
84
85
86
87struct x86_init_paging {
88 void (*pagetable_setup_start)(pgd_t *base);
89 void (*pagetable_setup_done)(pgd_t *base);
90};
91
92
93
94
95
96
97
98
99
100struct x86_init_timers {
101 void (*setup_percpu_clockev)(void);
102 void (*tsc_pre_init)(void);
103 void (*timer_init)(void);
104 void (*wallclock_init)(void);
105};
106
107
108
109
110
111struct x86_init_iommu {
112 int (*iommu_init)(void);
113};
114
115
116
117
118
119
120
121
122struct x86_init_pci {
123 int (*arch_init)(void);
124 int (*init)(void);
125 void (*init_irq)(void);
126 void (*fixup_irqs)(void);
127};
128
129
130
131
132
133struct x86_init_ops {
134 struct x86_init_resources resources;
135 struct x86_init_mpparse mpparse;
136 struct x86_init_irqs irqs;
137 struct x86_init_oem oem;
138 struct x86_init_mapping mapping;
139 struct x86_init_paging paging;
140 struct x86_init_timers timers;
141 struct x86_init_iommu iommu;
142 struct x86_init_pci pci;
143};
144
145
146
147
148
149
150struct x86_cpuinit_ops {
151 void (*setup_percpu_clockev)(void);
152 void (*early_percpu_clock_init)(void);
153 void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node);
154};
155
156
157
158
159
160
161
162
163
164
165
166
167
168struct x86_platform_ops {
169 unsigned long (*calibrate_tsc)(void);
170 unsigned long (*get_wallclock)(void);
171 int (*set_wallclock)(unsigned long nowtime);
172 void (*iommu_shutdown)(void);
173 bool (*is_untracked_pat_range)(u64 start, u64 end);
174 void (*nmi_init)(void);
175 unsigned char (*get_nmi_reason)(void);
176 int (*i8042_detect)(void);
177 void (*save_sched_clock_state)(void);
178 void (*restore_sched_clock_state)(void);
179 void (*apic_post_init)(void);
180};
181
182struct pci_dev;
183
184struct x86_msi_ops {
185 int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type);
186 void (*teardown_msi_irq)(unsigned int irq);
187 void (*teardown_msi_irqs)(struct pci_dev *dev);
188 void (*restore_msi_irqs)(struct pci_dev *dev, int irq);
189};
190
191struct x86_io_apic_ops {
192 void (*init) (void);
193 unsigned int (*read) (unsigned int apic, unsigned int reg);
194 void (*write) (unsigned int apic, unsigned int reg, unsigned int value);
195 void (*modify)(unsigned int apic, unsigned int reg, unsigned int value);
196};
197
198extern struct x86_init_ops x86_init;
199extern struct x86_cpuinit_ops x86_cpuinit;
200extern struct x86_platform_ops x86_platform;
201extern struct x86_msi_ops x86_msi;
202extern struct x86_io_apic_ops x86_io_apic_ops;
203extern void x86_init_noop(void);
204extern void x86_init_uint_noop(unsigned int unused);
205
206#endif
207