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/db10a303545e
branches:  trunk
changeset: 969217:db10a303545e
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 c29b644bdd5d -r db10a303545e 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