x86, apic: clean up ->setup_apic_routing()
[safe/jmp/linux-2.6] / arch / x86 / include / asm / genapic.h
1 #ifndef _ASM_X86_GENAPIC_H
2 #define _ASM_X86_GENAPIC_H
3
4 #include <linux/cpumask.h>
5
6 #include <asm/mpspec.h>
7 #include <asm/atomic.h>
8
9 /*
10  * Copyright 2004 James Cleverdon, IBM.
11  * Subject to the GNU Public License, v.2
12  *
13  * Generic APIC sub-arch data struct.
14  *
15  * Hacked for x86-64 by James Cleverdon from i386 architecture code by
16  * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
17  * James Cleverdon.
18  */
19 struct genapic {
20         char *name;
21
22         int (*probe)(void);
23         int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
24         int (*apic_id_registered)(void);
25
26         u32 irq_delivery_mode;
27         u32 irq_dest_mode;
28
29         const struct cpumask *(*target_cpus)(void);
30
31         int disable_esr;
32
33         int dest_logical;
34         unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
35         unsigned long (*check_apicid_present)(int apicid);
36
37         void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
38         void (*init_apic_ldr)(void);
39
40         physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
41
42         void (*setup_apic_routing)(void);
43         int (*multi_timer_check)(int apic, int irq);
44         int (*apicid_to_node)(int logical_apicid);
45         int (*cpu_to_logical_apicid)(int cpu);
46         int (*cpu_present_to_apicid)(int mps_cpu);
47         physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
48         void (*setup_portio_remap)(void);
49         int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
50         void (*enable_apic_mode)(void);
51 #ifdef CONFIG_X86_32
52         u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
53 #else
54         unsigned int (*phys_pkg_id)(int index_msb);
55 #endif
56
57         /*
58          * When one of the next two hooks returns 1 the genapic
59          * is switched to this. Essentially they are additional
60          * probe functions:
61          */
62         int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
63                              char *productid);
64
65         unsigned int (*get_apic_id)(unsigned long x);
66         unsigned long (*set_apic_id)(unsigned int id);
67         unsigned long apic_id_mask;
68
69         unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
70         unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
71                                                const struct cpumask *andmask);
72
73         /* ipi */
74         void (*send_IPI_mask)(const struct cpumask *mask, int vector);
75         void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
76                                          int vector);
77         void (*send_IPI_allbutself)(int vector);
78         void (*send_IPI_all)(int vector);
79         void (*send_IPI_self)(int vector);
80
81         /* wakeup_secondary_cpu */
82         int (*wakeup_cpu)(int apicid, unsigned long start_eip);
83
84         int trampoline_phys_low;
85         int trampoline_phys_high;
86
87         void (*wait_for_init_deassert)(atomic_t *deassert);
88         void (*smp_callin_clear_local_apic)(void);
89         void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
90         void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
91         void (*inquire_remote_apic)(int apicid);
92 };
93
94 extern struct genapic *apic;
95
96 #ifdef CONFIG_X86_32
97 extern void es7000_update_genapic_to_cluster(void);
98 #else
99 extern struct genapic apic_flat;
100 extern struct genapic apic_physflat;
101 extern struct genapic apic_x2apic_cluster;
102 extern struct genapic apic_x2apic_phys;
103 extern int default_acpi_madt_oem_check(char *, char *);
104
105 extern void apic_send_IPI_self(int vector);
106
107 extern struct genapic apic_x2apic_uv_x;
108 DECLARE_PER_CPU(int, x2apic_extra_bits);
109
110 extern void default_setup_apic_routing(void);
111 #endif
112
113 #endif /* _ASM_X86_GENAPIC_64_H */