Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/aarch64/include Define the MULTIPROCESSOR cpu_numbe...
details: https://anonhg.NetBSD.org/src/rev/5eb18ba51b93
branches: trunk
changeset: 744751:5eb18ba51b93
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Feb 12 06:05:46 2020 +0000
description:
Define the MULTIPROCESSOR cpu_number() for modules too.
Modules should work whether the main kernel is multiprocessor or not.
In particular, dtrace should not think cpu_number() is 0 while
cpu_index(curcpu()) and curcpu()->ci_index are nonzero, leading to
rather spectacularly bogus results...
diffstat:
sys/arch/aarch64/include/cpu.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r 8f6ea67b1168 -r 5eb18ba51b93 sys/arch/aarch64/include/cpu.h
--- a/sys/arch/aarch64/include/cpu.h Wed Feb 12 06:05:31 2020 +0000
+++ b/sys/arch/aarch64/include/cpu.h Wed Feb 12 06:05:46 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.19 2020/01/15 08:34:04 mrg Exp $ */
+/* $NetBSD: cpu.h,v 1.20 2020/02/12 06:05:46 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -134,7 +134,7 @@
bool cpu_hatched_p(u_int); /* MULTIPROCESSOR */
#define CPU_INFO_ITERATOR cpuid_t
-#ifdef MULTIPROCESSOR
+#if defined(MULTIPROCESSOR) || defined(_MODULE)
#define cpu_number() (curcpu()->ci_index)
#define CPU_IS_PRIMARY(ci) ((ci)->ci_index == 0)
#define CPU_INFO_FOREACH(cii, ci) \
Home |
Main Index |
Thread Index |
Old Index