summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2021-07-06 09:34:08 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2021-07-06 09:34:08 +0000
commit056fc36d68af9f71b8980f4c1c61d7fc71bd954f (patch)
tree127690efe61582ecde42d810c1122e0446cec8b3 /sys/arch/powerpc64
parentdc4ee67851e0c7410f3cf2aaf4b94c0580fd4771 (diff)
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@
Diffstat (limited to 'sys/arch/powerpc64')
-rw-r--r--sys/arch/powerpc64/include/cpu.h4
1 files changed, 3 insertions, 1 deletions
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 <kettenis@openbsd.org>
@@ -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)