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/mips64/include/cpu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/arch/mips64/include') diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index 79b0a2484ca..57aa201089a 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.134 2021/06/02 00:39:26 cheloha Exp $ */ +/* $OpenBSD: cpu.h,v 1.135 2021/07/06 09:34:06 kettenis Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -225,6 +225,7 @@ extern void (*cpu_idle_cycle_func)(void); extern struct cpu_info *get_cpu_info(int); #define curcpu() getcurcpu() #define CPU_IS_PRIMARY(ci) ((ci)->ci_flags & CPUF_PRIMARY) +#define CPU_IS_RUNNING(ci) ((ci)->ci_flags & CPUF_RUNNING) #define cpu_number() (curcpu()->ci_cpuid) extern struct cpuset cpus_running; @@ -249,6 +250,7 @@ void smp_rendezvous_cpus(unsigned long, void (*)(void *), void *arg); #define MAXCPUS 1 #define curcpu() (&cpu_info_primary) #define CPU_IS_PRIMARY(ci) 1 +#define CPU_IS_RUNNING(ci) 1 #define cpu_number() 0UL #define cpu_unidle(ci) #define get_cpu_info(i) (&cpu_info_primary) -- cgit v1.2.3