ia64/xen-unstable

view xen/include/asm-x86/genapic.h @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
line source
1 #ifndef _ASM_GENAPIC_H
2 #define _ASM_GENAPIC_H 1
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 */
15 struct mpc_config_translation;
16 struct mpc_config_bus;
17 struct mp_config_table;
18 struct mpc_config_processor;
20 struct genapic {
21 char *name;
22 int (*probe)(void);
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 void (*init_apic_ldr)(void);
34 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
36 void (*clustered_apic_check)(void);
37 int (*multi_timer_check)(int apic, int irq);
38 int (*apicid_to_node)(int logical_apicid);
39 int (*cpu_to_logical_apicid)(int cpu);
40 int (*cpu_present_to_apicid)(int mps_cpu);
41 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
42 int (*mpc_apic_id)(struct mpc_config_processor *m,
43 struct mpc_config_translation *t);
44 void (*setup_portio_remap)(void);
45 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
46 void (*enable_apic_mode)(void);
47 u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
49 /* mpparse */
50 void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *,
51 struct mpc_config_translation *);
52 void (*mpc_oem_pci_bus)(struct mpc_config_bus *,
53 struct mpc_config_translation *);
55 /* When one of the next two hooks returns 1 the genapic
56 is switched to this. Essentially they are additional probe
57 functions. */
58 int (*mps_oem_check)(struct mp_config_table *mpc, char *oem,
59 char *productid);
60 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
62 unsigned (*get_apic_id)(unsigned long x);
63 unsigned long apic_id_mask;
64 unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
66 /* ipi */
67 void (*send_IPI_mask)(cpumask_t mask, int vector);
68 void (*send_IPI_allbutself)(int vector);
69 void (*send_IPI_all)(int vector);
70 };
72 #define APICFUNC(x) .x = x
74 #define APIC_INIT(aname, aprobe) { \
75 .name = aname, \
76 .probe = aprobe, \
77 .int_delivery_mode = INT_DELIVERY_MODE, \
78 .int_dest_mode = INT_DEST_MODE, \
79 .no_balance_irq = NO_BALANCE_IRQ, \
80 .ESR_DISABLE = esr_disable, \
81 .apic_destination_logical = APIC_DEST_LOGICAL, \
82 APICFUNC(apic_id_registered), \
83 APICFUNC(target_cpus), \
84 APICFUNC(check_apicid_used), \
85 APICFUNC(check_apicid_present), \
86 APICFUNC(init_apic_ldr), \
87 APICFUNC(ioapic_phys_id_map), \
88 APICFUNC(clustered_apic_check), \
89 APICFUNC(multi_timer_check), \
90 APICFUNC(apicid_to_node), \
91 APICFUNC(cpu_to_logical_apicid), \
92 APICFUNC(cpu_present_to_apicid), \
93 APICFUNC(apicid_to_cpu_present), \
94 APICFUNC(mpc_apic_id), \
95 APICFUNC(setup_portio_remap), \
96 APICFUNC(check_phys_apicid_present), \
97 APICFUNC(mpc_oem_bus_info), \
98 APICFUNC(mpc_oem_pci_bus), \
99 APICFUNC(mps_oem_check), \
100 APICFUNC(get_apic_id), \
101 .apic_id_mask = APIC_ID_MASK, \
102 APICFUNC(cpu_mask_to_apicid), \
103 APICFUNC(acpi_madt_oem_check), \
104 APICFUNC(send_IPI_mask), \
105 APICFUNC(send_IPI_allbutself), \
106 APICFUNC(send_IPI_all), \
107 APICFUNC(enable_apic_mode), \
108 APICFUNC(phys_pkg_id), \
109 }
111 extern struct genapic *genapic;
113 #endif