diff options
-rw-r--r-- | include/linux/cpu.h | 8 | ||||
-rw-r--r-- | init/main.c | 2 | ||||
-rw-r--r-- | kernel/Makefile | 1 | ||||
-rw-r--r-- | kernel/cpu/Makefile | 1 | ||||
-rw-r--r-- | kernel/cpu/idle.c | 10 |
5 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index ce7a074f2519..7419e30c55fb 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -212,4 +212,12 @@ static inline int disable_nonboot_cpus(void) { return 0; } | |||
212 | static inline void enable_nonboot_cpus(void) {} | 212 | static inline void enable_nonboot_cpus(void) {} |
213 | #endif /* !CONFIG_PM_SLEEP_SMP */ | 213 | #endif /* !CONFIG_PM_SLEEP_SMP */ |
214 | 214 | ||
215 | enum cpuhp_state { | ||
216 | CPUHP_OFFLINE, | ||
217 | CPUHP_ONLINE, | ||
218 | }; | ||
219 | |||
220 | void cpu_startup_entry(enum cpuhp_state state); | ||
221 | void cpu_idle(void); | ||
222 | |||
215 | #endif /* _LINUX_CPU_H_ */ | 223 | #endif /* _LINUX_CPU_H_ */ |
diff --git a/init/main.c b/init/main.c index 63534a141b4e..adb179d3e0f8 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -384,7 +384,7 @@ static noinline void __init_refok rest_init(void) | |||
384 | init_idle_bootup_task(current); | 384 | init_idle_bootup_task(current); |
385 | schedule_preempt_disabled(); | 385 | schedule_preempt_disabled(); |
386 | /* Call into cpu_idle with preempt disabled */ | 386 | /* Call into cpu_idle with preempt disabled */ |
387 | cpu_idle(); | 387 | cpu_startup_entry(CPUHP_ONLINE); |
388 | } | 388 | } |
389 | 389 | ||
390 | /* Check for early params. */ | 390 | /* Check for early params. */ |
diff --git a/kernel/Makefile b/kernel/Makefile index bbde5f1a4486..d1574d47cf27 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -24,6 +24,7 @@ endif | |||
24 | 24 | ||
25 | obj-y += sched/ | 25 | obj-y += sched/ |
26 | obj-y += power/ | 26 | obj-y += power/ |
27 | obj-y += cpu/ | ||
27 | 28 | ||
28 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o | 29 | obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o |
29 | obj-$(CONFIG_FREEZER) += freezer.o | 30 | obj-$(CONFIG_FREEZER) += freezer.o |
diff --git a/kernel/cpu/Makefile b/kernel/cpu/Makefile new file mode 100644 index 000000000000..59ab052ef7a0 --- /dev/null +++ b/kernel/cpu/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-y = idle.o | |||
diff --git a/kernel/cpu/idle.c b/kernel/cpu/idle.c new file mode 100644 index 000000000000..1908f00e0e98 --- /dev/null +++ b/kernel/cpu/idle.c | |||
@@ -0,0 +1,10 @@ | |||
1 | /* | ||
2 | * Generic entry point for the idle threads | ||
3 | */ | ||
4 | #include <linux/sched.h> | ||
5 | #include <linux/cpu.h> | ||
6 | |||
7 | void cpu_startup_entry(enum cpuhp_state state) | ||
8 | { | ||
9 | cpu_idle(); | ||
10 | } | ||