diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2017-11-25 23:41:05 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2017-11-25 23:41:05 +0000 |
commit | efe67753ccbbbba0013dac241c79d2dc124d76a2 (patch) | |
tree | 4be85fd57c569410684dbdb83ad09998aa8530c4 /sys/kern/subr_pcpu.c | |
parent | 91419bdafdfee515afb4e20e5c92035cc19074bb (diff) | |
download | src-efe67753ccbbbba0013dac241c79d2dc124d76a2.tar.gz src-efe67753ccbbbba0013dac241c79d2dc124d76a2.zip |
Remove some, but not all, assumptions that the BSP is CPU 0 and that CPUs
are numbered densely from there to n_cpus.
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=326218
Diffstat (limited to 'sys/kern/subr_pcpu.c')
-rw-r--r-- | sys/kern/subr_pcpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index 6b7907b558c5..06e5d18b3302 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -279,6 +279,8 @@ pcpu_destroy(struct pcpu *pcpu) struct pcpu * pcpu_find(u_int cpuid) { + KASSERT(cpuid_to_pcpu[cpuid] != NULL, + ("Getting uninitialized PCPU %d", cpuid)); return (cpuid_to_pcpu[cpuid]); } @@ -409,7 +411,7 @@ DB_SHOW_ALL_COMMAND(pcpu, db_show_cpu_all) int id; db_printf("Current CPU: %d\n\n", PCPU_GET(cpuid)); - for (id = 0; id <= mp_maxid; id++) { + CPU_FOREACH(id) { pc = pcpu_find(id); if (pc != NULL) { show_pcpu(pc); |