The patch titled
ppc64: Make idle_loop a ppc_md function
has been added to the -mm tree. Its filename is
ppc64-make-idle_loop-a-ppc_md-function.patch
Patches currently in -mm which might be from [EMAIL PROTECTED] are
ppc64-make-idle_loop-a-ppc_md-function.patch
ppc64-move-iseries_idle-into-iseries_setupc.patch
ppc64-move-pseries-idle-functions-into-pseries_setupc.patch
ppc64-fixup-platforms-for-new-ppc_mdidle.patch
ppc64-remove-obsolete-idle_setup.patch
ppc64-be-consistent-about-printing-which-idle-loop-were-using.patch
From: Michael Ellerman <[EMAIL PROTECTED]>
This patch adds an idle member to the ppc_md structure and calls it from
cpu_idle(). If a platform leaves ppc_md.idle as null it will get the default
idle loop default_idle().
Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
Signed-off-by: Anton Blanchard <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
arch/ppc64/kernel/idle.c | 8 +++++---
arch/ppc64/kernel/setup.c | 6 +++---
include/asm-ppc64/machdep.h | 5 +++++
3 files changed, 13 insertions(+), 6 deletions(-)
diff -puN arch/ppc64/kernel/idle.c~ppc64-make-idle_loop-a-ppc_md-function
arch/ppc64/kernel/idle.c
--- 25/arch/ppc64/kernel/idle.c~ppc64-make-idle_loop-a-ppc_md-function Wed Jul
6 14:10:06 2005
+++ 25-akpm/arch/ppc64/kernel/idle.c Wed Jul 6 14:10:06 2005
@@ -33,6 +33,7 @@
#include <asm/iSeries/ItLpQueue.h>
#include <asm/plpar_wrappers.h>
#include <asm/systemcfg.h>
+#include <asm/machdep.h>
extern void power4_idle(void);
@@ -122,7 +123,7 @@ static int iSeries_idle(void)
#else
-static int default_idle(void)
+int default_idle(void)
{
long oldval;
unsigned int cpu = smp_processor_id();
@@ -288,7 +289,7 @@ static int shared_idle(void)
#endif /* CONFIG_PPC_PSERIES */
-static int native_idle(void)
+int native_idle(void)
{
while(1) {
/* check CPU type here */
@@ -308,7 +309,8 @@ static int native_idle(void)
void cpu_idle(void)
{
- idle_loop();
+ BUG_ON(NULL == ppc_md.idle_loop);
+ ppc_md.idle_loop();
}
int powersave_nap;
diff -puN arch/ppc64/kernel/setup.c~ppc64-make-idle_loop-a-ppc_md-function
arch/ppc64/kernel/setup.c
--- 25/arch/ppc64/kernel/setup.c~ppc64-make-idle_loop-a-ppc_md-function Wed Jul
6 14:10:06 2005
+++ 25-akpm/arch/ppc64/kernel/setup.c Wed Jul 6 14:10:06 2005
@@ -96,7 +96,6 @@ extern void udbg_init_maple_realmode(voi
extern unsigned long klimit;
extern void mm_init_ppc64(void);
-extern int idle_setup(void);
extern void stab_initialize(unsigned long stab);
extern void htab_initialize(void);
extern void early_init_devtree(void *flat_dt);
@@ -1081,8 +1080,9 @@ void __init setup_arch(char **cmdline_p)
ppc_md.setup_arch();
- /* Select the correct idle loop for the platform. */
- idle_setup();
+ /* Use the default idle loop if the platform hasn't provided one. */
+ if (NULL == ppc_md.idle_loop)
+ ppc_md.idle_loop = default_idle;
paging_init();
ppc64_boot_msg(0x15, "Setup Done");
diff -puN include/asm-ppc64/machdep.h~ppc64-make-idle_loop-a-ppc_md-function
include/asm-ppc64/machdep.h
--- 25/include/asm-ppc64/machdep.h~ppc64-make-idle_loop-a-ppc_md-function
Wed Jul 6 14:10:06 2005
+++ 25-akpm/include/asm-ppc64/machdep.h Wed Jul 6 14:10:06 2005
@@ -140,8 +140,13 @@ struct machdep_calls {
unsigned long size,
pgprot_t vma_prot);
+ /* Idle loop for this platform, leave empty for default idle loop */
+ int (*idle_loop)(void);
};
+extern int default_idle(void);
+extern int native_idle(void);
+
extern struct machdep_calls ppc_md;
extern char cmd_line[COMMAND_LINE_SIZE];
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html