aboutsummaryrefslogtreecommitdiff
path: root/riscv/sim.cc
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r--riscv/sim.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc
index 57e9630..f4919c9 100644
--- a/riscv/sim.cc
+++ b/riscv/sim.cc
@@ -176,15 +176,19 @@ sim_t::sim_t(const cfg_t *cfg, bool halted,
}
//per core attribute
- int cpu_offset = 0, rc;
+ int cpu_offset = 0, cpu_map_offset, rc;
size_t cpu_idx = 0;
cpu_offset = fdt_get_offset(fdt, "/cpus");
+ cpu_map_offset = fdt_get_offset(fdt, "/cpus/cpu-map");
if (cpu_offset < 0)
return;
for (cpu_offset = fdt_get_first_subnode(fdt, cpu_offset); cpu_offset >= 0;
cpu_offset = fdt_get_next_subnode(fdt, cpu_offset)) {
+ if (!(cpu_map_offset < 0) && cpu_offset == cpu_map_offset)
+ continue;
+
if (cpu_idx >= nprocs())
break;