This source file includes following definitions.
- arch_send_wakeup_ipi_mask
- cpu_park_loop
- update_cpu_boot_status
- cpu_panic_kernel
1
2
3
4
5 #ifndef __ASM_SMP_H
6 #define __ASM_SMP_H
7
8 #include <linux/const.h>
9
10
11 #define CPU_STUCK_REASON_SHIFT (8)
12 #define CPU_BOOT_STATUS_MASK ((UL(1) << CPU_STUCK_REASON_SHIFT) - 1)
13
14 #define CPU_MMU_OFF (-1)
15 #define CPU_BOOT_SUCCESS (0)
16
17 #define CPU_KILL_ME (1)
18
19 #define CPU_STUCK_IN_KERNEL (2)
20
21 #define CPU_PANIC_KERNEL (3)
22
23 #define CPU_STUCK_REASON_52_BIT_VA (UL(1) << CPU_STUCK_REASON_SHIFT)
24 #define CPU_STUCK_REASON_NO_GRAN (UL(2) << CPU_STUCK_REASON_SHIFT)
25
26 #ifndef __ASSEMBLY__
27
28 #include <asm/percpu.h>
29
30 #include <linux/threads.h>
31 #include <linux/cpumask.h>
32 #include <linux/thread_info.h>
33
34 DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
35
36
37
38
39
40
41
42
43 #define raw_smp_processor_id() (*raw_cpu_ptr(&cpu_number))
44
45
46
47
48 extern u64 __cpu_logical_map[NR_CPUS];
49 #define cpu_logical_map(cpu) __cpu_logical_map[cpu]
50
51 struct seq_file;
52
53
54
55
56 extern void show_ipi_list(struct seq_file *p, int prec);
57
58
59
60
61 extern void handle_IPI(int ipinr, struct pt_regs *regs);
62
63
64
65
66
67 extern void smp_init_cpus(void);
68
69
70
71
72 extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
73
74 extern void (*__smp_cross_call)(const struct cpumask *, unsigned int);
75
76
77
78
79 asmlinkage void secondary_start_kernel(void);
80
81
82
83
84
85
86
87 struct secondary_data {
88 void *stack;
89 struct task_struct *task;
90 long status;
91 };
92
93 extern struct secondary_data secondary_data;
94 extern long __early_cpu_boot_status;
95 extern void secondary_entry(void);
96
97 extern void arch_send_call_function_single_ipi(int cpu);
98 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
99
100 #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
101 extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask);
102 #else
103 static inline void arch_send_wakeup_ipi_mask(const struct cpumask *mask)
104 {
105 BUILD_BUG();
106 }
107 #endif
108
109 extern int __cpu_disable(void);
110
111 extern void __cpu_die(unsigned int cpu);
112 extern void cpu_die(void);
113 extern void cpu_die_early(void);
114
115 static inline void cpu_park_loop(void)
116 {
117 for (;;) {
118 wfe();
119 wfi();
120 }
121 }
122
123 static inline void update_cpu_boot_status(int val)
124 {
125 WRITE_ONCE(secondary_data.status, val);
126
127 dsb(ishst);
128 }
129
130
131
132
133
134
135 static inline void cpu_panic_kernel(void)
136 {
137 update_cpu_boot_status(CPU_PANIC_KERNEL);
138 cpu_park_loop();
139 }
140
141
142
143
144
145
146
147
148
149
150
151 bool cpus_are_stuck_in_kernel(void);
152
153 extern void crash_smp_send_stop(void);
154 extern bool smp_crash_stop_failed(void);
155
156 #endif
157
158 #endif