From 056fc36d68af9f71b8980f4c1c61d7fc71bd954f Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 6 Jul 2021 09:34:08 +0000 Subject: Introduce CPU_IS_RUNNING() and us it in scheduler-related code to prevent waiting on CPUs that didn't spin up. This will allow us to spin down CPUs in the future to save power as well. ok mpi@ --- sys/arch/powerpc64/include/cpu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/arch/powerpc64') diff --git a/sys/arch/powerpc64/include/cpu.h b/sys/arch/powerpc64/include/cpu.h index 0bd905be3f8..7825e62dfbc 100644 --- a/sys/arch/powerpc64/include/cpu.h +++ b/sys/arch/powerpc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.30 2021/06/02 00:39:27 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.31 2021/07/06 09:34:07 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -130,6 +130,7 @@ curcpu(void) #define MAXCPUS 1 #define CPU_IS_PRIMARY(ci) 1 +#define CPU_IS_RUNNING(ci) 1 #define cpu_number() 0 #define CPU_INFO_UNIT(ci) 0 @@ -143,6 +144,7 @@ curcpu(void) #define MAXCPUS 48 #define CPU_IS_PRIMARY(ci) ((ci) == cpu_info_primary) +#define CPU_IS_RUNNING(ci) ((ci)->ci_flags & CPUF_RUNNING) #define cpu_number() (curcpu()->ci_cpuid) #define CPU_INFO_UNIT(ci) ((ci)->ci_dev ? (ci)->ci_dev->dv_unit : 0) -- cgit v1.2.3