-/* $OpenBSD: generic3a_machdep.c,v 1.10 2020/07/21 05:56:02 visa Exp $ */
+/* $OpenBSD: generic3a_machdep.c,v 1.11 2021/07/24 08:21:13 visa Exp $ */
/*
* Copyright (c) 2009, 2010, 2012 Miodrag Vallat.
REGVAL64(ls3_ipi_base[ci->ci_cpuid] + LS3_IPI_MBOX0) =
(uint64_t)hw_cpu_spinup_trampoline; /* pc */
- while (!cpuset_isset(&cpus_running, ci))
- continue;
+ while (!CPU_IS_RUNNING(ci))
+ membar_sync();
}
int
-/* $OpenBSD: machdep.c,v 1.98 2021/07/12 09:32:37 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.99 2021/07/24 08:21:13 visa Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
membar_sync();
ncpus++;
- cpuset_add(&cpus_running, ci);
spl0();
(void)updateimask(0);
-/* $OpenBSD: cpu.h,v 1.135 2021/07/06 09:34:06 kettenis Exp $ */
+/* $OpenBSD: cpu.h,v 1.136 2021/07/24 08:21:13 visa Exp $ */
/*-
* Copyright (c) 1992, 1993
#define CPU_IS_RUNNING(ci) ((ci)->ci_flags & CPUF_RUNNING)
#define cpu_number() (curcpu()->ci_cpuid)
-extern struct cpuset cpus_running;
void cpu_unidle(struct cpu_info *);
void cpu_boot_secondary_processors(void);
#define cpu_boot_secondary(ci) hw_cpu_boot_secondary(ci)
-/* $OpenBSD: cpu.c,v 1.79 2021/05/28 16:33:36 visa Exp $ */
+/* $OpenBSD: cpu.c,v 1.80 2021/07/24 08:21:13 visa Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
struct cpu_info cpu_info_primary;
struct cpu_info *cpu_info_list = &cpu_info_primary;
struct cpu_info *cpu_info_secondaries;
-#ifdef MULTIPROCESSOR
-struct cpuset cpus_running;
-#endif
extern void cpu_idle_cycle_nop(void);
extern void cpu_idle_cycle_wait(void);
ci = &cpu_info_primary;
#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
- cpuset_add(&cpus_running, ci);
if (ncpusfound > 1) {
cpu_info_secondaries = (struct cpu_info *)
alloc_contiguous_pages(sizeof(struct cpu_info) *
-/* $OpenBSD: ipifuncs.c,v 1.23 2021/07/20 07:53:39 visa Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.24 2021/07/24 08:21:13 visa Exp $ */
/* $NetBSD: ipifuncs.c,v 1.40 2008/04/28 20:23:10 martin Exp $ */
/*-
if (ci == NULL)
panic("mips_send_ipi: bogus cpu_id");
- if (!cpuset_isset(&cpus_running, ci))
- panic("mips_send_ipi: CPU %u not running", cpuid);
+ if (!CPU_IS_RUNNING(ci))
+ panic("mips_send_ipi: CPU %u not running", cpuid);
#endif
atomic_setbits_int(&ipi_mailbox[cpuid], ipimask);
membar_producer();
CPU_INFO_FOREACH(cii, ci) {
- if (!(cpumask & (1UL << ci->ci_cpuid)) ||
- !cpuset_isset(&cpus_running, ci))
+ if (!(cpumask & (1UL << ci->ci_cpuid)) || !CPU_IS_RUNNING(ci))
continue;
do_send_ipi(ci->ci_cpuid, ipimask);
}
-/* $OpenBSD: pmap.c,v 1.118 2021/05/05 15:29:19 visa Exp $ */
+/* $OpenBSD: pmap.c,v 1.119 2021/07/24 08:21:13 visa Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
pmap_swlock(pmap);
CPU_INFO_FOREACH(cii, ci) {
- if (cpuset_isset(&cpus_running, ci) &&
+ if (CPU_IS_RUNNING(ci) &&
pmap->pm_asid[ci->ci_cpuid].pma_asidgen != 0)
cpumask |= 1ul << ci->ci_cpuid;
}
CPU_INFO_FOREACH(cii, ci) {
if (ci == self)
continue;
- if (!cpuset_isset(&cpus_running, ci))
+ if (!CPU_IS_RUNNING(ci))
continue;
if (pmap != pmap_kernel()) {
if (pmap->pm_asid[ci->ci_cpuid].pma_asidgen !=
-/* $OpenBSD: machdep.c,v 1.133 2021/07/12 09:32:37 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.134 2021/07/24 08:21:13 visa Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
cpu_spinup_mask = (uint32_t)ci->ci_cpuid;
- while (!cpuset_isset(&cpus_running, ci))
- ;
+ while (!CPU_IS_RUNNING(ci))
+ membar_sync();
}
void
membar_sync();
ncpus++;
- cpuset_add(&cpus_running, ci);
spl0();
(void)updateimask(0);