1#ifndef _ASM_X86_IPI_H
2#define _ASM_X86_IPI_H
3
4#ifdef CONFIG_X86_LOCAL_APIC
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <asm/hw_irq.h>
24#include <asm/apic.h>
25#include <asm/smp.h>
26
27
28
29
30
31
32
33static inline unsigned int __prepare_ICR(unsigned int shortcut, int vector,
34 unsigned int dest)
35{
36 unsigned int icr = shortcut | dest;
37
38 switch (vector) {
39 default:
40 icr |= APIC_DM_FIXED | vector;
41 break;
42 case NMI_VECTOR:
43 icr |= APIC_DM_NMI;
44 break;
45 }
46 return icr;
47}
48
49static inline int __prepare_ICR2(unsigned int mask)
50{
51 return SET_APIC_DEST_FIELD(mask);
52}
53
54static inline void __xapic_wait_icr_idle(void)
55{
56 while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY)
57 cpu_relax();
58}
59
60void __default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest);
61
62
63
64
65
66void __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest);
67
68extern void default_send_IPI_single(int cpu, int vector);
69extern void default_send_IPI_single_phys(int cpu, int vector);
70extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
71 int vector);
72extern void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
73 int vector);
74
75
76#define NMI_VECTOR 0x02
77
78extern int no_broadcast;
79
80static inline void __default_local_send_IPI_allbutself(int vector)
81{
82 if (no_broadcast || vector == NMI_VECTOR)
83 apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
84 else
85 __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical);
86}
87
88static inline void __default_local_send_IPI_all(int vector)
89{
90 if (no_broadcast || vector == NMI_VECTOR)
91 apic->send_IPI_mask(cpu_online_mask, vector);
92 else
93 __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical);
94}
95
96#ifdef CONFIG_X86_32
97extern void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
98 int vector);
99extern void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask,
100 int vector);
101extern void default_send_IPI_mask_logical(const struct cpumask *mask,
102 int vector);
103extern void default_send_IPI_allbutself(int vector);
104extern void default_send_IPI_all(int vector);
105extern void default_send_IPI_self(int vector);
106#endif
107
108#endif
109
110#endif
111