diff options
Diffstat (limited to 'include/asm-i386/genapic.h')
-rw-r--r-- | include/asm-i386/genapic.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h new file mode 100644 index 000000000000..fc813b2e8274 --- /dev/null +++ b/include/asm-i386/genapic.h | |||
@@ -0,0 +1,115 @@ | |||
1 | #ifndef _ASM_GENAPIC_H | ||
2 | #define _ASM_GENAPIC_H 1 | ||
3 | |||
4 | /* | ||
5 | * Generic APIC driver interface. | ||
6 | * | ||
7 | * An straight forward mapping of the APIC related parts of the | ||
8 | * x86 subarchitecture interface to a dynamic object. | ||
9 | * | ||
10 | * This is used by the "generic" x86 subarchitecture. | ||
11 | * | ||
12 | * Copyright 2003 Andi Kleen, SuSE Labs. | ||
13 | */ | ||
14 | |||
15 | struct mpc_config_translation; | ||
16 | struct mpc_config_bus; | ||
17 | struct mp_config_table; | ||
18 | struct mpc_config_processor; | ||
19 | |||
20 | struct genapic { | ||
21 | char *name; | ||
22 | int (*probe)(void); | ||
23 | |||
24 | int (*apic_id_registered)(void); | ||
25 | cpumask_t (*target_cpus)(void); | ||
26 | int int_delivery_mode; | ||
27 | int int_dest_mode; | ||
28 | int ESR_DISABLE; | ||
29 | int apic_destination_logical; | ||
30 | unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid); | ||
31 | unsigned long (*check_apicid_present)(int apicid); | ||
32 | int no_balance_irq; | ||
33 | int no_ioapic_check; | ||
34 | void (*init_apic_ldr)(void); | ||
35 | physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); | ||
36 | |||
37 | void (*clustered_apic_check)(void); | ||
38 | int (*multi_timer_check)(int apic, int irq); | ||
39 | int (*apicid_to_node)(int logical_apicid); | ||
40 | int (*cpu_to_logical_apicid)(int cpu); | ||
41 | int (*cpu_present_to_apicid)(int mps_cpu); | ||
42 | physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); | ||
43 | int (*mpc_apic_id)(struct mpc_config_processor *m, | ||
44 | struct mpc_config_translation *t); | ||
45 | void (*setup_portio_remap)(void); | ||
46 | int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); | ||
47 | void (*enable_apic_mode)(void); | ||
48 | u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb); | ||
49 | |||
50 | /* mpparse */ | ||
51 | void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *, | ||
52 | struct mpc_config_translation *); | ||
53 | void (*mpc_oem_pci_bus)(struct mpc_config_bus *, | ||
54 | struct mpc_config_translation *); | ||
55 | |||
56 | /* When one of the next two hooks returns 1 the genapic | ||
57 | is switched to this. Essentially they are additional probe | ||
58 | functions. */ | ||
59 | int (*mps_oem_check)(struct mp_config_table *mpc, char *oem, | ||
60 | char *productid); | ||
61 | int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); | ||
62 | |||
63 | unsigned (*get_apic_id)(unsigned long x); | ||
64 | unsigned long apic_id_mask; | ||
65 | unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask); | ||
66 | |||
67 | /* ipi */ | ||
68 | void (*send_IPI_mask)(cpumask_t mask, int vector); | ||
69 | void (*send_IPI_allbutself)(int vector); | ||
70 | void (*send_IPI_all)(int vector); | ||
71 | }; | ||
72 | |||
73 | #define APICFUNC(x) .x = x | ||
74 | |||
75 | #define APIC_INIT(aname, aprobe) { \ | ||
76 | .name = aname, \ | ||
77 | .probe = aprobe, \ | ||
78 | .int_delivery_mode = INT_DELIVERY_MODE, \ | ||
79 | .int_dest_mode = INT_DEST_MODE, \ | ||
80 | .no_balance_irq = NO_BALANCE_IRQ, \ | ||
81 | .no_ioapic_check = NO_IOAPIC_CHECK, \ | ||
82 | .ESR_DISABLE = esr_disable, \ | ||
83 | .apic_destination_logical = APIC_DEST_LOGICAL, \ | ||
84 | APICFUNC(apic_id_registered), \ | ||
85 | APICFUNC(target_cpus), \ | ||
86 | APICFUNC(check_apicid_used), \ | ||
87 | APICFUNC(check_apicid_present), \ | ||
88 | APICFUNC(init_apic_ldr), \ | ||
89 | APICFUNC(ioapic_phys_id_map), \ | ||
90 | APICFUNC(clustered_apic_check), \ | ||
91 | APICFUNC(multi_timer_check), \ | ||
92 | APICFUNC(apicid_to_node), \ | ||
93 | APICFUNC(cpu_to_logical_apicid), \ | ||
94 | APICFUNC(cpu_present_to_apicid), \ | ||
95 | APICFUNC(apicid_to_cpu_present), \ | ||
96 | APICFUNC(mpc_apic_id), \ | ||
97 | APICFUNC(setup_portio_remap), \ | ||
98 | APICFUNC(check_phys_apicid_present), \ | ||
99 | APICFUNC(mpc_oem_bus_info), \ | ||
100 | APICFUNC(mpc_oem_pci_bus), \ | ||
101 | APICFUNC(mps_oem_check), \ | ||
102 | APICFUNC(get_apic_id), \ | ||
103 | .apic_id_mask = APIC_ID_MASK, \ | ||
104 | APICFUNC(cpu_mask_to_apicid), \ | ||
105 | APICFUNC(acpi_madt_oem_check), \ | ||
106 | APICFUNC(send_IPI_mask), \ | ||
107 | APICFUNC(send_IPI_allbutself), \ | ||
108 | APICFUNC(send_IPI_all), \ | ||
109 | APICFUNC(enable_apic_mode), \ | ||
110 | APICFUNC(phys_pkg_id), \ | ||
111 | } | ||
112 | |||
113 | extern struct genapic *genapic; | ||
114 | |||
115 | #endif | ||