summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary King <gking@nvidia.com>2010-03-24 14:46:53 -0700
committerGary King <gking@nvidia.com>2010-03-29 17:21:42 -0800
commitdcf183c1230421a18ca15ef199e7d8f1970e0c22 (patch)
tree18e3a92f89febfc4077e98fd7d64705518f21375
parent65a6a2cbbe8c6a161c26da44c9c134e45566148c (diff)
ARM: enable CONFIG_CPU_IDLE support
add ARCH_HAS_CPU_IDLE_WAIT and ARCH_HAS_DEFAULT_IDLE configuration, and expose default_idle and cpu_idle_wait cpu_idle_wait implementation based on the implementation in the x86 tree Change-Id: Ie24b6336db833cc638868abfdba822889646d0a8 Reviewed-on: http://git-master/r/950 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
-rw-r--r--arch/arm/Kconfig8
-rw-r--r--arch/arm/include/asm/system.h2
-rw-r--r--arch/arm/kernel/process.c16
3 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8065d1c7502f..c4ff83b87884 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -120,6 +120,14 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM
bool
+config ARCH_HAS_CPU_IDLE_WAIT
+ bool
+ default y
+
+config ARCH_HAS_DEFAULT_IDLE
+ bool
+ default y
+
config ARCH_HAS_ILOG2_U32
bool
default n
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index f149e9ffab30..2e3d2a7695e3 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -97,6 +97,8 @@ extern void __show_regs(struct pt_regs *);
extern int cpu_architecture(void);
extern void cpu_init(void);
+extern void cpu_idle_wait(void);
+extern void default_idle(void);
void arm_machine_restart(char mode);
extern void (*arm_pm_restart)(char str);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index c06f0481163b..d3729c3fd8e7 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -128,7 +128,7 @@ EXPORT_SYMBOL_GPL(arm_pm_restart);
* This is our default idle handler. We need to disable
* interrupts here to ensure we don't miss a wakeup call.
*/
-static void default_idle(void)
+void default_idle(void)
{
if (hlt_counter)
cpu_relax();
@@ -139,6 +139,7 @@ static void default_idle(void)
local_irq_enable();
}
}
+EXPORT_SYMBOL(default_idle);
/*
* The idle thread. We try to conserve power, while trying to keep
@@ -174,6 +175,19 @@ void cpu_idle(void)
}
}
+#if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT)
+static void do_nothing(void *unused)
+{
+}
+
+void cpu_idle_wait(void)
+{
+ smp_mb();
+ smp_call_function(do_nothing, NULL, 1);
+}
+#endif
+
+
static char reboot_mode = 'h';
int __init reboot_setup(char *str)