H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_GENAPIC_64_H |
| 2 | #define _ASM_X86_GENAPIC_64_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
Mike Travis | e798673 | 2008-12-16 17:33:52 -0800 | [diff] [blame] | 4 | #include <linux/cpumask.h> |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | /* |
| 7 | * Copyright 2004 James Cleverdon, IBM. |
| 8 | * Subject to the GNU Public License, v.2 |
| 9 | * |
| 10 | * Generic APIC sub-arch data struct. |
| 11 | * |
| 12 | * Hacked for x86-64 by James Cleverdon from i386 architecture code by |
| 13 | * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and |
| 14 | * James Cleverdon. |
| 15 | */ |
| 16 | |
| 17 | struct genapic { |
| 18 | char *name; |
Yinghai Lu | 1b9b89e | 2008-07-21 22:08:21 -0700 | [diff] [blame] | 19 | int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | u32 int_delivery_mode; |
| 21 | u32 int_dest_mode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | int (*apic_id_registered)(void); |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 23 | const struct cpumask *(*target_cpus)(void); |
| 24 | void (*vector_allocation_domain)(int cpu, struct cpumask *retmask); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | void (*init_apic_ldr)(void); |
| 26 | /* ipi */ |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 27 | void (*send_IPI_mask)(const struct cpumask *mask, int vector); |
| 28 | void (*send_IPI_mask_allbutself)(const struct cpumask *mask, |
| 29 | int vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | void (*send_IPI_allbutself)(int vector); |
| 31 | void (*send_IPI_all)(int vector); |
Suresh Siddha | cff73a6 | 2008-07-10 11:16:53 -0700 | [diff] [blame] | 32 | void (*send_IPI_self)(int vector); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | /* */ |
Mike Travis | bcda016 | 2008-12-16 17:33:59 -0800 | [diff] [blame] | 34 | unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask); |
Mike Travis | 6eeb7c5 | 2008-12-16 17:33:55 -0800 | [diff] [blame] | 35 | unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, |
| 36 | const struct cpumask *andmask); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | unsigned int (*phys_pkg_id)(int index_msb); |
Yinghai Lu | f910a9d | 2008-07-12 01:01:20 -0700 | [diff] [blame] | 38 | unsigned int (*get_apic_id)(unsigned long x); |
| 39 | unsigned long (*set_apic_id)(unsigned int id); |
| 40 | unsigned long apic_id_mask; |
Yinghai Lu | 54ac14a | 2008-11-17 15:19:53 -0800 | [diff] [blame] | 41 | /* wakeup_secondary_cpu */ |
| 42 | int (*wakeup_cpu)(int apicid, unsigned long start_eip); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
Andrew Morton | 3dc68d9 | 2007-05-02 19:27:04 +0200 | [diff] [blame] | 45 | extern struct genapic *genapic; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
Ingo Molnar | 07c7c47 | 2007-05-02 19:27:04 +0200 | [diff] [blame] | 47 | extern struct genapic apic_flat; |
| 48 | extern struct genapic apic_physflat; |
Suresh Siddha | 12a67cf | 2008-07-10 11:16:54 -0700 | [diff] [blame] | 49 | extern struct genapic apic_x2apic_cluster; |
Suresh Siddha | 2d9579a | 2008-07-10 11:16:59 -0700 | [diff] [blame] | 50 | extern struct genapic apic_x2apic_phys; |
Jack Steiner | ae26186 | 2008-03-28 14:12:06 -0500 | [diff] [blame] | 51 | extern int acpi_madt_oem_check(char *, char *); |
| 52 | |
Suresh Siddha | cff73a6 | 2008-07-10 11:16:53 -0700 | [diff] [blame] | 53 | extern void apic_send_IPI_self(int vector); |
Jack Steiner | ae26186 | 2008-03-28 14:12:06 -0500 | [diff] [blame] | 54 | enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; |
| 55 | extern enum uv_system_type get_uv_system_type(void); |
| 56 | extern int is_uv_system(void); |
Ingo Molnar | 07c7c47 | 2007-05-02 19:27:04 +0200 | [diff] [blame] | 57 | |
Jack Steiner | ac23d4e | 2008-03-28 14:12:16 -0500 | [diff] [blame] | 58 | extern struct genapic apic_x2apic_uv_x; |
| 59 | DECLARE_PER_CPU(int, x2apic_extra_bits); |
| 60 | extern void uv_cpu_init(void); |
Marcin Slusarz | c4bd1fd | 2008-08-21 20:49:05 +0200 | [diff] [blame] | 61 | extern void uv_system_init(void); |
Jack Steiner | ac23d4e | 2008-03-28 14:12:16 -0500 | [diff] [blame] | 62 | extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); |
| 63 | |
Thomas Gleixner | 88a8335 | 2008-05-02 23:19:26 +0200 | [diff] [blame] | 64 | extern void setup_apic_routing(void); |
| 65 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 66 | #endif /* _ASM_X86_GENAPIC_64_H */ |