patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / asm-i386 / genapic.h
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 apic_broadcast_id; 
29         int ESR_DISABLE;
30         int apic_destination_logical;
31         unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
32         unsigned long (*check_apicid_present)(int apicid); 
33         int no_balance_irq;
34         int no_ioapic_check;
35         void (*init_apic_ldr)(void);
36         physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
37
38         void (*clustered_apic_check)(void);
39         int (*multi_timer_check)(int apic, int irq);
40         int (*apicid_to_node)(int logical_apicid); 
41         int (*cpu_to_logical_apicid)(int cpu);
42         int (*cpu_present_to_apicid)(int mps_cpu);
43         physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
44         int (*mpc_apic_id)(struct mpc_config_processor *m, 
45                            struct mpc_config_translation *t); 
46         void (*setup_portio_remap)(void); 
47         int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
48         void (*enable_apic_mode)(void);
49         u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
50
51         /* mpparse */
52         void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *, 
53                                  struct mpc_config_translation *);
54         void (*mpc_oem_pci_bus)(struct mpc_config_bus *, 
55                                 struct mpc_config_translation *); 
56
57         /* When one of the next two hooks returns 1 the genapic
58            is switched to this. Essentially they are additional probe 
59            functions. */
60         int (*mps_oem_check)(struct mp_config_table *mpc, char *oem, 
61                               char *productid);
62         int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
63
64         unsigned (*get_apic_id)(unsigned long x);
65         unsigned long apic_id_mask;
66         unsigned int (*cpu_mask_to_apicid)(cpumask_const_t cpumask);
67         
68         /* ipi */
69         void (*send_IPI_mask)(cpumask_t mask, int vector);
70         void (*send_IPI_allbutself)(int vector);
71         void (*send_IPI_all)(int vector);
72 }; 
73
74 #define APICFUNC(x) .x = x
75
76 #define APIC_INIT(aname, aprobe) { \
77         .name = aname, \
78         .probe = aprobe, \
79         .int_delivery_mode = INT_DELIVERY_MODE, \
80         .int_dest_mode = INT_DEST_MODE, \
81         .apic_broadcast_id = APIC_BROADCAST_ID, \
82         .no_balance_irq = NO_BALANCE_IRQ, \
83         .no_ioapic_check = NO_IOAPIC_CHECK, \
84         .ESR_DISABLE = esr_disable, \
85         .apic_destination_logical = APIC_DEST_LOGICAL, \
86         APICFUNC(apic_id_registered), \
87         APICFUNC(target_cpus), \
88         APICFUNC(check_apicid_used), \
89         APICFUNC(check_apicid_present), \
90         APICFUNC(init_apic_ldr), \
91         APICFUNC(ioapic_phys_id_map), \
92         APICFUNC(clustered_apic_check), \
93         APICFUNC(multi_timer_check), \
94         APICFUNC(apicid_to_node), \
95         APICFUNC(cpu_to_logical_apicid), \
96         APICFUNC(cpu_present_to_apicid), \
97         APICFUNC(apicid_to_cpu_present), \
98         APICFUNC(mpc_apic_id), \
99         APICFUNC(setup_portio_remap), \
100         APICFUNC(check_phys_apicid_present), \
101         APICFUNC(mpc_oem_bus_info), \
102         APICFUNC(mpc_oem_pci_bus), \
103         APICFUNC(mps_oem_check), \
104         APICFUNC(get_apic_id), \
105         .apic_id_mask = APIC_ID_MASK, \
106         APICFUNC(cpu_mask_to_apicid), \
107         APICFUNC(acpi_madt_oem_check), \
108         APICFUNC(send_IPI_mask), \
109         APICFUNC(send_IPI_allbutself), \
110         APICFUNC(send_IPI_all), \
111         APICFUNC(enable_apic_mode), \
112         APICFUNC(phys_pkg_id), \
113         }
114
115 extern struct genapic *genapic;
116
117 #endif