From 34726ba5d543ef7f1bb234c751bd318190397f28 Mon Sep 17 00:00:00 2001 From: Nicholas Piggin Date: Fri, 17 Dec 2021 12:17:23 +1000 Subject: core/cpu: make cpu idle states simpler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework the CPU idle state code: * in_idle is true for any kind of idle including spinning. This is not used anywhere except for state assertions for now. * in_sleep is true for idle that requires an IPI to wake up. * in_job_sleep is true for in_sleep idle which is also cpu_wake_on_job. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- include/cpu.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cpu.h b/include/cpu.h index b0c78ce..d0fc6cc 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -60,8 +60,9 @@ struct cpu_thread { bool in_poller; bool in_reinit; bool in_fast_sleep; - bool in_sleep; - bool in_idle; + bool in_idle; /* any idle state, even busy wait */ + bool in_sleep; /* idle which requires IPI */ + bool in_job_sleep; /* requires IPI and cpu_wake_on_job */ uint32_t hbrt_spec_wakeup; /* primary only */ uint64_t save_l2_fir_action1; uint64_t current_token; -- cgit v1.1