]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/asm-x86/mach-default/mach_ipi.h
x86: fix reboot with no keyboard attached
[mirror_ubuntu-zesty-kernel.git] / include / asm-x86 / mach-default / mach_ipi.h
1 #ifndef __ASM_MACH_IPI_H
2 #define __ASM_MACH_IPI_H
3
4 /* Avoid include hell */
5 #define NMI_VECTOR 0x02
6
7 void send_IPI_mask_bitmask(cpumask_t mask, int vector);
8 void __send_IPI_shortcut(unsigned int shortcut, int vector);
9
10 extern int no_broadcast;
11
12 static inline void send_IPI_mask(cpumask_t mask, int vector)
13 {
14 send_IPI_mask_bitmask(mask, vector);
15 }
16
17 static inline void __local_send_IPI_allbutself(int vector)
18 {
19 if (no_broadcast || vector == NMI_VECTOR) {
20 cpumask_t mask = cpu_online_map;
21
22 cpu_clear(smp_processor_id(), mask);
23 send_IPI_mask(mask, vector);
24 } else
25 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
26 }
27
28 static inline void __local_send_IPI_all(int vector)
29 {
30 if (no_broadcast || vector == NMI_VECTOR)
31 send_IPI_mask(cpu_online_map, vector);
32 else
33 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
34 }
35
36 static inline void send_IPI_allbutself(int vector)
37 {
38 /*
39 * if there are no other CPUs in the system then we get an APIC send
40 * error if we try to broadcast, thus avoid sending IPIs in this case.
41 */
42 if (!(num_online_cpus() > 1))
43 return;
44
45 __local_send_IPI_allbutself(vector);
46 return;
47 }
48
49 static inline void send_IPI_all(int vector)
50 {
51 __local_send_IPI_all(vector);
52 }
53
54 #endif /* __ASM_MACH_IPI_H */