blob: adf32fb56aa638d2aa160d25986f7c93ac6d3ba0 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_GENAPIC_64_H
2#define _ASM_X86_GENAPIC_64_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Mike Travise7986732008-12-16 17:33:52 -08004#include <linux/cpumask.h>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006/*
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
17struct genapic {
18 char *name;
Yinghai Lu1b9b89e2008-07-21 22:08:21 -070019 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 u32 int_delivery_mode;
21 u32 int_dest_mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 int (*apic_id_registered)(void);
Mike Travisbcda0162008-12-16 17:33:59 -080023 const struct cpumask *(*target_cpus)(void);
24 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 void (*init_apic_ldr)(void);
26 /* ipi */
Mike Travisbcda0162008-12-16 17:33:59 -080027 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
28 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
29 int vector);
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 void (*send_IPI_allbutself)(int vector);
31 void (*send_IPI_all)(int vector);
Suresh Siddhacff73a62008-07-10 11:16:53 -070032 void (*send_IPI_self)(int vector);
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 /* */
Mike Travisbcda0162008-12-16 17:33:59 -080034 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
Mike Travis6eeb7c52008-12-16 17:33:55 -080035 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
36 const struct cpumask *andmask);
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 unsigned int (*phys_pkg_id)(int index_msb);
Yinghai Luf910a9d2008-07-12 01:01:20 -070038 unsigned int (*get_apic_id)(unsigned long x);
39 unsigned long (*set_apic_id)(unsigned int id);
40 unsigned long apic_id_mask;
Yinghai Lu54ac14a2008-11-17 15:19:53 -080041 /* wakeup_secondary_cpu */
42 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043};
44
Andrew Morton3dc68d92007-05-02 19:27:04 +020045extern struct genapic *genapic;
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Ingo Molnar07c7c472007-05-02 19:27:04 +020047extern struct genapic apic_flat;
48extern struct genapic apic_physflat;
Suresh Siddha12a67cf2008-07-10 11:16:54 -070049extern struct genapic apic_x2apic_cluster;
Suresh Siddha2d9579a2008-07-10 11:16:59 -070050extern struct genapic apic_x2apic_phys;
Jack Steinerae261862008-03-28 14:12:06 -050051extern int acpi_madt_oem_check(char *, char *);
52
Suresh Siddhacff73a62008-07-10 11:16:53 -070053extern void apic_send_IPI_self(int vector);
Jack Steinerae261862008-03-28 14:12:06 -050054enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
55extern enum uv_system_type get_uv_system_type(void);
56extern int is_uv_system(void);
Ingo Molnar07c7c472007-05-02 19:27:04 +020057
Jack Steinerac23d4e2008-03-28 14:12:16 -050058extern struct genapic apic_x2apic_uv_x;
59DECLARE_PER_CPU(int, x2apic_extra_bits);
60extern void uv_cpu_init(void);
Marcin Slusarzc4bd1fd2008-08-21 20:49:05 +020061extern void uv_system_init(void);
Jack Steinerac23d4e2008-03-28 14:12:16 -050062extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip);
63
Thomas Gleixner88a83352008-05-02 23:19:26 +020064extern void setup_apic_routing(void);
65
H. Peter Anvin1965aae2008-10-22 22:26:29 -070066#endif /* _ASM_X86_GENAPIC_64_H */