aboutsummaryrefslogtreecommitdiff
path: root/core/cpu.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-07-24 09:27:19 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-22 15:26:51 +1000
commit36be5e0ac86e6aeb020a2e37cc146cc2ff7a6bb5 (patch)
tree221917586e0dd5bda44d277c07176b370420da36 /core/cpu.c
parent373bd8314bcc27c2093a56d456db960e9980d494 (diff)
downloadskiboot-36be5e0ac86e6aeb020a2e37cc146cc2ff7a6bb5.zip
skiboot-36be5e0ac86e6aeb020a2e37cc146cc2ff7a6bb5.tar.gz
skiboot-36be5e0ac86e6aeb020a2e37cc146cc2ff7a6bb5.tar.bz2
cpu: Add cpu_idle() which we call when waiting for a job
For now a simple generic implementation using cpu_relax() Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/cpu.c')
-rw-r--r--core/cpu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/cpu.c b/core/cpu.c
index 79cb70c..529232d 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -212,6 +212,24 @@ void cpu_process_jobs(void)
unlock(&cpu->job_lock);
}
+static void cpu_idle_default(enum cpu_wake_cause wake_on __unused)
+{
+ /* Maybe do something better for simulators ? */
+ cpu_relax();
+ cpu_relax();
+ cpu_relax();
+ cpu_relax();
+}
+
+void cpu_idle(enum cpu_wake_cause wake_on)
+{
+ switch(proc_gen) {
+ default:
+ cpu_idle_default(wake_on);
+ break;
+ }
+}
+
void cpu_process_local_jobs(void)
{
struct cpu_thread *cpu = first_available_cpu();