]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/x86/include/asm/genapic.h
x86, smp: eliminate asm/mach-default/mach_wakecpu.h
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / genapic.h
CommitLineData
ef7471b1
IM
1#ifndef _ASM_X86_GENAPIC_H
2#define _ASM_X86_GENAPIC_H
3
4#include <linux/cpumask.h>
5
505deeb1
IM
6#include <asm/mpspec.h>
7#include <asm/atomic.h>
8
ef7471b1
IM
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 */
ef7471b1
IM
19struct 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
f8987a10
IM
26 u32 irq_delivery_mode;
27 u32 irq_dest_mode;
ef7471b1
IM
28
29 const struct cpumask *(*target_cpus)(void);
30
08125d3e 31 int disable_esr;
ef7471b1 32
bdb1a9b6 33 int dest_logical;
ef7471b1
IM
34 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
35 unsigned long (*check_apicid_present)(int apicid);
36
ef7471b1
IM
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);
d4c9a9f3 51 int (*phys_pkg_id)(int cpuid_apic, int index_msb);
ef7471b1
IM
52
53 /*
54 * When one of the next two hooks returns 1 the genapic
55 * is switched to this. Essentially they are additional
56 * probe functions:
57 */
5f836405 58 int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid);
ef7471b1
IM
59
60 unsigned int (*get_apic_id)(unsigned long x);
61 unsigned long (*set_apic_id)(unsigned int id);
62 unsigned long apic_id_mask;
63
64 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
65 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
66 const struct cpumask *andmask);
67
ef7471b1
IM
68 /* ipi */
69 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
70 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
71 int vector);
72 void (*send_IPI_allbutself)(int vector);
73 void (*send_IPI_all)(int vector);
74 void (*send_IPI_self)(int vector);
6781d948 75
ef7471b1
IM
76 /* wakeup_secondary_cpu */
77 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
78
79 int trampoline_phys_low;
80 int trampoline_phys_high;
505deeb1 81
ef7471b1
IM
82 void (*wait_for_init_deassert)(atomic_t *deassert);
83 void (*smp_callin_clear_local_apic)(void);
84 void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
ef7471b1
IM
85 void (*inquire_remote_apic)(int apicid);
86};
87
c8d46cf0 88extern struct genapic *apic;
ced733ec 89
abfa584c
IM
90/*
91 * Warm reset vector default position:
92 */
93#define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467
94#define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469
95
505deeb1 96#ifdef CONFIG_X86_32
ced733ec 97extern void es7000_update_genapic_to_cluster(void);
9a6801da 98#else
ced733ec
IM
99extern struct genapic apic_flat;
100extern struct genapic apic_physflat;
101extern struct genapic apic_x2apic_cluster;
102extern struct genapic apic_x2apic_phys;
306db03b 103extern int default_acpi_madt_oem_check(char *, char *);
ced733ec
IM
104
105extern void apic_send_IPI_self(int vector);
106
107extern struct genapic apic_x2apic_uv_x;
108DECLARE_PER_CPU(int, x2apic_extra_bits);
109
72ce0165 110extern void default_setup_apic_routing(void);
a21769a4
IM
111
112extern int default_cpu_present_to_apicid(int mps_cpu);
a27a6210 113extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
9a6801da 114#endif
ced733ec 115
0939e4fd
IM
116static inline void default_wait_for_init_deassert(atomic_t *deassert)
117{
118 while (!atomic_read(deassert))
119 cpu_relax();
120 return;
121}
122
ef7471b1 123#endif /* _ASM_X86_GENAPIC_64_H */