lkml.org 
[lkml]   [2013]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 04/34] idle: Provide a generic entry point for the idle code
For now this calls cpu_idle(), but in the long run we want to move the
cpu bringup code to the core and therefor we add a state argument.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/cpu.h | 8 ++++++++
init/main.c | 2 +-
kernel/Makefile | 1 +
kernel/cpu/Makefile | 1 +
kernel/cpu/idle.c | 10 ++++++++++
5 files changed, 21 insertions(+), 1 deletion(-)

Index: linux-2.6/include/linux/cpu.h
===================================================================
--- linux-2.6.orig/include/linux/cpu.h
+++ linux-2.6/include/linux/cpu.h
@@ -212,4 +212,12 @@ static inline int disable_nonboot_cpus(v
static inline void enable_nonboot_cpus(void) {}
#endif /* !CONFIG_PM_SLEEP_SMP */

+enum cpuhp_state {
+ CPUHP_OFFLINE,
+ CPUHP_ONLINE,
+};
+
+void cpu_startup_entry(enum cpuhp_state state);
+void cpu_idle(void);
+
#endif /* _LINUX_CPU_H_ */
Index: linux-2.6/init/main.c
===================================================================
--- linux-2.6.orig/init/main.c
+++ linux-2.6/init/main.c
@@ -384,7 +384,7 @@ static noinline void __init_refok rest_i
init_idle_bootup_task(current);
schedule_preempt_disabled();
/* Call into cpu_idle with preempt disabled */
- cpu_idle();
+ cpu_startup_entry(CPUHP_ONLINE);
}

/* Check for early params. */
Index: linux-2.6/kernel/Makefile
===================================================================
--- linux-2.6.orig/kernel/Makefile
+++ linux-2.6/kernel/Makefile
@@ -24,6 +24,7 @@ endif

obj-y += sched/
obj-y += power/
+obj-y += cpu/

obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
obj-$(CONFIG_FREEZER) += freezer.o
Index: linux-2.6/kernel/cpu/Makefile
===================================================================
--- /dev/null
+++ linux-2.6/kernel/cpu/Makefile
@@ -0,0 +1 @@
+obj-y = idle.o
Index: linux-2.6/kernel/cpu/idle.c
===================================================================
--- /dev/null
+++ linux-2.6/kernel/cpu/idle.c
@@ -0,0 +1,10 @@
+/*
+ * Generic entry point for the idle threads
+ */
+#include <linux/sched.h>
+#include <linux/cpu.h>
+
+void cpu_startup_entry(enum cpuhp_state state)
+{
+ cpu_idle();
+}



\
 
 \ /
  Last update: 2013-03-21 23:21    [W:0.600 / U:8.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site