Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 1 | #ifndef _ASM_X86_GENAPIC_H |
| 2 | #define _ASM_X86_GENAPIC_H |
| 3 | |
| 4 | #include <linux/cpumask.h> |
| 5 | |
Ingo Molnar | 505deeb | 2009-01-27 23:23:22 +0100 | [diff] [blame] | 6 | #include <asm/mpspec.h> |
| 7 | #include <asm/atomic.h> |
| 8 | |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 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 | */ |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 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 | |
Ingo Molnar | f8987a1 | 2009-01-28 04:02:31 +0100 | [diff] [blame] | 26 | u32 irq_delivery_mode; |
| 27 | u32 irq_dest_mode; |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 28 | |
| 29 | const struct cpumask *(*target_cpus)(void); |
| 30 | |
Ingo Molnar | 08125d3 | 2009-01-28 05:08:44 +0100 | [diff] [blame] | 31 | int disable_esr; |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 32 | |
Ingo Molnar | bdb1a9b | 2009-01-28 05:29:25 +0100 | [diff] [blame^] | 33 | int dest_logical; |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 34 | unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid); |
| 35 | unsigned long (*check_apicid_present)(int apicid); |
| 36 | |
| 37 | int no_balance_irq; |
| 38 | int no_ioapic_check; |
| 39 | |
| 40 | void (*vector_allocation_domain)(int cpu, struct cpumask *retmask); |
| 41 | void (*init_apic_ldr)(void); |
| 42 | |
| 43 | physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); |
| 44 | |
| 45 | void (*setup_apic_routing)(void); |
| 46 | int (*multi_timer_check)(int apic, int irq); |
| 47 | int (*apicid_to_node)(int logical_apicid); |
| 48 | int (*cpu_to_logical_apicid)(int cpu); |
| 49 | int (*cpu_present_to_apicid)(int mps_cpu); |
| 50 | physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); |
| 51 | void (*setup_portio_remap)(void); |
| 52 | int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); |
| 53 | void (*enable_apic_mode)(void); |
| 54 | #ifdef CONFIG_X86_32 |
| 55 | u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb); |
| 56 | #else |
| 57 | unsigned int (*phys_pkg_id)(int index_msb); |
| 58 | #endif |
| 59 | |
| 60 | /* |
| 61 | * When one of the next two hooks returns 1 the genapic |
| 62 | * is switched to this. Essentially they are additional |
| 63 | * probe functions: |
| 64 | */ |
| 65 | int (*mps_oem_check)(struct mpc_table *mpc, char *oem, |
| 66 | char *productid); |
| 67 | |
| 68 | unsigned int (*get_apic_id)(unsigned long x); |
| 69 | unsigned long (*set_apic_id)(unsigned int id); |
| 70 | unsigned long apic_id_mask; |
| 71 | |
| 72 | unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask); |
| 73 | unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, |
| 74 | const struct cpumask *andmask); |
| 75 | |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 76 | /* ipi */ |
| 77 | void (*send_IPI_mask)(const struct cpumask *mask, int vector); |
| 78 | void (*send_IPI_mask_allbutself)(const struct cpumask *mask, |
| 79 | int vector); |
| 80 | void (*send_IPI_allbutself)(int vector); |
| 81 | void (*send_IPI_all)(int vector); |
| 82 | void (*send_IPI_self)(int vector); |
Ingo Molnar | 6781d94 | 2009-01-27 23:54:23 +0100 | [diff] [blame] | 83 | |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 84 | /* wakeup_secondary_cpu */ |
| 85 | int (*wakeup_cpu)(int apicid, unsigned long start_eip); |
| 86 | |
| 87 | int trampoline_phys_low; |
| 88 | int trampoline_phys_high; |
Ingo Molnar | 505deeb | 2009-01-27 23:23:22 +0100 | [diff] [blame] | 89 | |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 90 | void (*wait_for_init_deassert)(atomic_t *deassert); |
| 91 | void (*smp_callin_clear_local_apic)(void); |
| 92 | void (*store_NMI_vector)(unsigned short *high, unsigned short *low); |
| 93 | void (*restore_NMI_vector)(unsigned short *high, unsigned short *low); |
| 94 | void (*inquire_remote_apic)(int apicid); |
| 95 | }; |
| 96 | |
Ingo Molnar | c8d46cf | 2009-01-28 00:14:11 +0100 | [diff] [blame] | 97 | extern struct genapic *apic; |
Ingo Molnar | ced733e | 2009-01-27 23:15:06 +0100 | [diff] [blame] | 98 | |
Ingo Molnar | 505deeb | 2009-01-27 23:23:22 +0100 | [diff] [blame] | 99 | #ifdef CONFIG_X86_32 |
Ingo Molnar | ced733e | 2009-01-27 23:15:06 +0100 | [diff] [blame] | 100 | extern void es7000_update_genapic_to_cluster(void); |
Ingo Molnar | 9a6801d | 2009-01-28 03:18:13 +0100 | [diff] [blame] | 101 | #else |
Ingo Molnar | ced733e | 2009-01-27 23:15:06 +0100 | [diff] [blame] | 102 | extern struct genapic apic_flat; |
| 103 | extern struct genapic apic_physflat; |
| 104 | extern struct genapic apic_x2apic_cluster; |
| 105 | extern struct genapic apic_x2apic_phys; |
Ingo Molnar | 306db03 | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 106 | extern int default_acpi_madt_oem_check(char *, char *); |
Ingo Molnar | ced733e | 2009-01-27 23:15:06 +0100 | [diff] [blame] | 107 | |
| 108 | extern void apic_send_IPI_self(int vector); |
| 109 | |
| 110 | extern struct genapic apic_x2apic_uv_x; |
| 111 | DECLARE_PER_CPU(int, x2apic_extra_bits); |
| 112 | |
| 113 | extern void setup_apic_routing(void); |
Ingo Molnar | 9a6801d | 2009-01-28 03:18:13 +0100 | [diff] [blame] | 114 | #endif |
Ingo Molnar | ced733e | 2009-01-27 23:15:06 +0100 | [diff] [blame] | 115 | |
Ingo Molnar | ef7471b | 2009-01-27 23:12:02 +0100 | [diff] [blame] | 116 | #endif /* _ASM_X86_GENAPIC_64_H */ |