diff options
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); |