diff options
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r-- | include/linux/cpu.h | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index d2ca8c38f9c4..f9b1fab4388a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/node.h> | 16 | #include <linux/node.h> |
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <linux/cpumask.h> | 18 | #include <linux/cpumask.h> |
19 | #include <linux/cpuhotplug.h> | ||
19 | 20 | ||
20 | struct device; | 21 | struct device; |
21 | struct device_node; | 22 | struct device_node; |
@@ -27,6 +28,9 @@ struct cpu { | |||
27 | struct device dev; | 28 | struct device dev; |
28 | }; | 29 | }; |
29 | 30 | ||
31 | extern void boot_cpu_init(void); | ||
32 | extern void boot_cpu_state_init(void); | ||
33 | |||
30 | extern int register_cpu(struct cpu *cpu, int num); | 34 | extern int register_cpu(struct cpu *cpu, int num); |
31 | extern struct device *get_cpu_device(unsigned cpu); | 35 | extern struct device *get_cpu_device(unsigned cpu); |
32 | extern bool cpu_is_hotpluggable(unsigned cpu); | 36 | extern bool cpu_is_hotpluggable(unsigned cpu); |
@@ -74,7 +78,7 @@ enum { | |||
74 | /* migration should happen before other stuff but after perf */ | 78 | /* migration should happen before other stuff but after perf */ |
75 | CPU_PRI_PERF = 20, | 79 | CPU_PRI_PERF = 20, |
76 | CPU_PRI_MIGRATION = 10, | 80 | CPU_PRI_MIGRATION = 10, |
77 | CPU_PRI_SMPBOOT = 9, | 81 | |
78 | /* bring up workqueues before normal notifiers and down after */ | 82 | /* bring up workqueues before normal notifiers and down after */ |
79 | CPU_PRI_WORKQUEUE_UP = 5, | 83 | CPU_PRI_WORKQUEUE_UP = 5, |
80 | CPU_PRI_WORKQUEUE_DOWN = -5, | 84 | CPU_PRI_WORKQUEUE_DOWN = -5, |
@@ -97,9 +101,7 @@ enum { | |||
97 | * Called on the new cpu, just before | 101 | * Called on the new cpu, just before |
98 | * enabling interrupts. Must not sleep, | 102 | * enabling interrupts. Must not sleep, |
99 | * must not fail */ | 103 | * must not fail */ |
100 | #define CPU_DYING_IDLE 0x000B /* CPU (unsigned)v dying, reached | 104 | #define CPU_BROKEN 0x000B /* CPU (unsigned)v did not die properly, |
101 | * idle loop. */ | ||
102 | #define CPU_BROKEN 0x000C /* CPU (unsigned)v did not die properly, | ||
103 | * perhaps due to preemption. */ | 105 | * perhaps due to preemption. */ |
104 | 106 | ||
105 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend | 107 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend |
@@ -118,6 +120,7 @@ enum { | |||
118 | 120 | ||
119 | 121 | ||
120 | #ifdef CONFIG_SMP | 122 | #ifdef CONFIG_SMP |
123 | extern bool cpuhp_tasks_frozen; | ||
121 | /* Need to know about CPUs going up/down? */ | 124 | /* Need to know about CPUs going up/down? */ |
122 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | 125 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) |
123 | #define cpu_notifier(fn, pri) { \ | 126 | #define cpu_notifier(fn, pri) { \ |
@@ -167,7 +170,6 @@ static inline void __unregister_cpu_notifier(struct notifier_block *nb) | |||
167 | } | 170 | } |
168 | #endif | 171 | #endif |
169 | 172 | ||
170 | void smpboot_thread_init(void); | ||
171 | int cpu_up(unsigned int cpu); | 173 | int cpu_up(unsigned int cpu); |
172 | void notify_cpu_starting(unsigned int cpu); | 174 | void notify_cpu_starting(unsigned int cpu); |
173 | extern void cpu_maps_update_begin(void); | 175 | extern void cpu_maps_update_begin(void); |
@@ -177,6 +179,7 @@ extern void cpu_maps_update_done(void); | |||
177 | #define cpu_notifier_register_done cpu_maps_update_done | 179 | #define cpu_notifier_register_done cpu_maps_update_done |
178 | 180 | ||
179 | #else /* CONFIG_SMP */ | 181 | #else /* CONFIG_SMP */ |
182 | #define cpuhp_tasks_frozen 0 | ||
180 | 183 | ||
181 | #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) | 184 | #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) |
182 | #define __cpu_notifier(fn, pri) do { (void)(fn); } while (0) | 185 | #define __cpu_notifier(fn, pri) do { (void)(fn); } while (0) |
@@ -215,10 +218,6 @@ static inline void cpu_notifier_register_done(void) | |||
215 | { | 218 | { |
216 | } | 219 | } |
217 | 220 | ||
218 | static inline void smpboot_thread_init(void) | ||
219 | { | ||
220 | } | ||
221 | |||
222 | #endif /* CONFIG_SMP */ | 221 | #endif /* CONFIG_SMP */ |
223 | extern struct bus_type cpu_subsys; | 222 | extern struct bus_type cpu_subsys; |
224 | 223 | ||
@@ -265,11 +264,6 @@ static inline int disable_nonboot_cpus(void) { return 0; } | |||
265 | static inline void enable_nonboot_cpus(void) {} | 264 | static inline void enable_nonboot_cpus(void) {} |
266 | #endif /* !CONFIG_PM_SLEEP_SMP */ | 265 | #endif /* !CONFIG_PM_SLEEP_SMP */ |
267 | 266 | ||
268 | enum cpuhp_state { | ||
269 | CPUHP_OFFLINE, | ||
270 | CPUHP_ONLINE, | ||
271 | }; | ||
272 | |||
273 | void cpu_startup_entry(enum cpuhp_state state); | 267 | void cpu_startup_entry(enum cpuhp_state state); |
274 | 268 | ||
275 | void cpu_idle_poll_ctrl(bool enable); | 269 | void cpu_idle_poll_ctrl(bool enable); |
@@ -280,14 +274,15 @@ void arch_cpu_idle_enter(void); | |||
280 | void arch_cpu_idle_exit(void); | 274 | void arch_cpu_idle_exit(void); |
281 | void arch_cpu_idle_dead(void); | 275 | void arch_cpu_idle_dead(void); |
282 | 276 | ||
283 | DECLARE_PER_CPU(bool, cpu_dead_idle); | ||
284 | |||
285 | int cpu_report_state(int cpu); | 277 | int cpu_report_state(int cpu); |
286 | int cpu_check_up_prepare(int cpu); | 278 | int cpu_check_up_prepare(int cpu); |
287 | void cpu_set_state_online(int cpu); | 279 | void cpu_set_state_online(int cpu); |
288 | #ifdef CONFIG_HOTPLUG_CPU | 280 | #ifdef CONFIG_HOTPLUG_CPU |
289 | bool cpu_wait_death(unsigned int cpu, int seconds); | 281 | bool cpu_wait_death(unsigned int cpu, int seconds); |
290 | bool cpu_report_death(void); | 282 | bool cpu_report_death(void); |
283 | void cpuhp_report_idle_dead(void); | ||
284 | #else | ||
285 | static inline void cpuhp_report_idle_dead(void) { } | ||
291 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ | 286 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ |
292 | 287 | ||
293 | #endif /* _LINUX_CPU_H_ */ | 288 | #endif /* _LINUX_CPU_H_ */ |