summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/include
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/arm64/include
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/arm64/include')
-rw-r--r--sys/arch/arm64/include/cpu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/arm64/include/cpu.h b/sys/arch/arm64/include/cpu.h
index 29f7d4d9a0e..9f9e4761aae 100644
--- a/sys/arch/arm64/include/cpu.h
+++ b/sys/arch/arm64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.21 2021/06/02 00:39:26 cheloha Exp $ */
+/* $OpenBSD: cpu.h,v 1.22 2021/07/06 09:34:06 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
*
@@ -161,6 +161,7 @@ extern struct cpu_info *cpu_info_list;
#ifndef MULTIPROCESSOR
#define cpu_number() 0
#define CPU_IS_PRIMARY(ci) 1
+#define CPU_IS_RUNNING(ci) 1
#define CPU_INFO_ITERATOR int
#define CPU_INFO_FOREACH(cii, ci) \
for (cii = 0, ci = curcpu(); ci != NULL; ci = NULL)
@@ -170,6 +171,7 @@ extern struct cpu_info *cpu_info_list;
#else
#define cpu_number() (curcpu()->ci_cpuid)
#define CPU_IS_PRIMARY(ci) ((ci) == &cpu_info_primary)
+#define CPU_IS_RUNNING(ci) ((ci)->ci_flags & CPUF_RUNNING)
#define CPU_INFO_ITERATOR int
#define CPU_INFO_FOREACH(cii, ci) for (cii = 0, ci = cpu_info_list; \
ci != NULL; ci = ci->ci_next)