Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent
[deliverable/linux.git] / arch / x86 / include / asm / genapic_32.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_GENAPIC_32_H
2#define _ASM_X86_GENAPIC_32_H
1da177e4 3
874c4fe3 4#include <asm/mpspec.h>
569712b2 5#include <asm/atomic.h>
874c4fe3 6
1da177e4
LT
7/*
8 * Generic APIC driver interface.
9 *
10 * An straight forward mapping of the APIC related parts of the
11 * x86 subarchitecture interface to a dynamic object.
12 *
13 * This is used by the "generic" x86 subarchitecture.
14 *
15 * Copyright 2003 Andi Kleen, SuSE Labs.
16 */
17
1da177e4
LT
18struct mpc_config_bus;
19struct mp_config_table;
20struct mpc_config_processor;
21
eee28c25
JP
22struct genapic {
23 char *name;
24 int (*probe)(void);
1da177e4
LT
25
26 int (*apic_id_registered)(void);
bcda016e 27 const struct cpumask *(*target_cpus)(void);
1da177e4 28 int int_delivery_mode;
eee28c25 29 int int_dest_mode;
1da177e4
LT
30 int ESR_DISABLE;
31 int apic_destination_logical;
32 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
eee28c25 33 unsigned long (*check_apicid_present)(int apicid);
1da177e4
LT
34 int no_balance_irq;
35 int no_ioapic_check;
36 void (*init_apic_ldr)(void);
37 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
38
3c43f039 39 void (*setup_apic_routing)(void);
1da177e4 40 int (*multi_timer_check)(int apic, int irq);
eee28c25 41 int (*apicid_to_node)(int logical_apicid);
1da177e4
LT
42 int (*cpu_to_logical_apicid)(int cpu);
43 int (*cpu_present_to_apicid)(int mps_cpu);
44 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
eee28c25 45 void (*setup_portio_remap)(void);
1da177e4
LT
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 */
1da177e4 51 /* When one of the next two hooks returns 1 the genapic
eee28c25 52 is switched to this. Essentially they are additional probe
1da177e4 53 functions. */
eee28c25
JP
54 int (*mps_oem_check)(struct mp_config_table *mpc, char *oem,
55 char *productid);
1da177e4
LT
56 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
57
58 unsigned (*get_apic_id)(unsigned long x);
59 unsigned long apic_id_mask;
bcda016e 60 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
6eeb7c5a
MT
61 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
62 const struct cpumask *andmask);
bcda016e 63 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
874c4fe3
AK
64
65#ifdef CONFIG_SMP
1da177e4 66 /* ipi */
bcda016e
MT
67 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
68 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
69 int vector);
1da177e4
LT
70 void (*send_IPI_allbutself)(int vector);
71 void (*send_IPI_all)(int vector);
874c4fe3 72#endif
54ac14a8 73 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
569712b2
YL
74 int trampoline_phys_low;
75 int trampoline_phys_high;
76 void (*wait_for_init_deassert)(atomic_t *deassert);
77 void (*smp_callin_clear_local_apic)(void);
78 void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
79 void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
80 void (*inquire_remote_apic)(int apicid);
eee28c25 81};
1da177e4 82
874c4fe3
AK
83#define APICFUNC(x) .x = x,
84
85/* More functions could be probably marked IPIFUNC and save some space
86 in UP GENERICARCH kernels, but I don't have the nerve right now
87 to untangle this mess. -AK */
88#ifdef CONFIG_SMP
89#define IPIFUNC(x) APICFUNC(x)
90#else
91#define IPIFUNC(x)
92#endif
1da177e4 93
eee28c25
JP
94#define APIC_INIT(aname, aprobe) \
95{ \
96 .name = aname, \
97 .probe = aprobe, \
98 .int_delivery_mode = INT_DELIVERY_MODE, \
99 .int_dest_mode = INT_DEST_MODE, \
100 .no_balance_irq = NO_BALANCE_IRQ, \
101 .ESR_DISABLE = esr_disable, \
102 .apic_destination_logical = APIC_DEST_LOGICAL, \
103 APICFUNC(apic_id_registered) \
104 APICFUNC(target_cpus) \
105 APICFUNC(check_apicid_used) \
106 APICFUNC(check_apicid_present) \
107 APICFUNC(init_apic_ldr) \
108 APICFUNC(ioapic_phys_id_map) \
109 APICFUNC(setup_apic_routing) \
110 APICFUNC(multi_timer_check) \
111 APICFUNC(apicid_to_node) \
112 APICFUNC(cpu_to_logical_apicid) \
113 APICFUNC(cpu_present_to_apicid) \
114 APICFUNC(apicid_to_cpu_present) \
115 APICFUNC(setup_portio_remap) \
116 APICFUNC(check_phys_apicid_present) \
117 APICFUNC(mps_oem_check) \
118 APICFUNC(get_apic_id) \
119 .apic_id_mask = APIC_ID_MASK, \
120 APICFUNC(cpu_mask_to_apicid) \
95d313cf 121 APICFUNC(cpu_mask_to_apicid_and) \
569712b2 122 APICFUNC(vector_allocation_domain) \
eee28c25
JP
123 APICFUNC(acpi_madt_oem_check) \
124 IPIFUNC(send_IPI_mask) \
125 IPIFUNC(send_IPI_allbutself) \
126 IPIFUNC(send_IPI_all) \
127 APICFUNC(enable_apic_mode) \
128 APICFUNC(phys_pkg_id) \
569712b2
YL
129 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \
130 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \
131 APICFUNC(wait_for_init_deassert) \
132 APICFUNC(smp_callin_clear_local_apic) \
133 APICFUNC(store_NMI_vector) \
134 APICFUNC(restore_NMI_vector) \
135 APICFUNC(inquire_remote_apic) \
eee28c25 136}
1da177e4 137
a86f34b4 138extern struct genapic *genapic;
b5fe363b 139extern void es7000_update_genapic_to_cluster(void);
1da177e4 140
ae261868
JS
141enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
142#define get_uv_system_type() UV_NONE
143#define is_uv_system() 0
34d05591 144#define uv_wakeup_secondary(a, b) 1
c4bd1fda 145#define uv_system_init() do {} while (0)
ae261868
JS
146
147
1965aae3 148#endif /* _ASM_X86_GENAPIC_32_H */
This page took 0.50008 seconds and 5 git commands to generate.