aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r--sys/kern/subr_smp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 935fb6ee977c..bfe890d773f9 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -630,6 +630,17 @@ smp_rendezvous(void (* setup_func)(void *),
static struct cpu_group group[MAXCPU * MAX_CACHE_LEVELS + 1];
+static void
+smp_topo_fill(struct cpu_group *cg)
+{
+ int c;
+
+ for (c = 0; c < cg->cg_children; c++)
+ smp_topo_fill(&cg->cg_child[c]);
+ cg->cg_first = CPU_FFS(&cg->cg_mask) - 1;
+ cg->cg_last = CPU_FLS(&cg->cg_mask) - 1;
+}
+
struct cpu_group *
smp_topo(void)
{
@@ -693,6 +704,7 @@ smp_topo(void)
top = &top->cg_child[0];
top->cg_parent = NULL;
}
+ smp_topo_fill(top);
return (top);
}