diff options
author | Tan En De <ende.tan@starfivetech.com> | 2023-04-11 18:15:46 +0800 |
---|---|---|
committer | Tan En De <ende.tan@starfivetech.com> | 2023-12-12 12:50:33 +0800 |
commit | 221eb465c6960b3e005b3a49d8a62ec481bb357b (patch) | |
tree | 638e919e2fba03c55b2a5e288251b59ccffbf790 /riscv | |
parent | 0b52bb625556477865b2a77f47ae3ceacbc2cd5c (diff) | |
download | spike-221eb465c6960b3e005b3a49d8a62ec481bb357b.zip spike-221eb465c6960b3e005b3a49d8a62ec481bb357b.tar.gz spike-221eb465c6960b3e005b3a49d8a62ec481bb357b.tar.bz2 |
riscv: sim.cc: Consider cpu-map node in cpus node
cpu-map node may be present in cpus node.
https://github.com/torvalds/linux/commit/124e46a86580c71e0eee8459c5da7649318118db
So this commit adds logic to consider that by skipping cpu-map node.
Signed-off-by: Tan En De <ende.tan@starfivetech.com>
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/sim.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc index dcbd469..2ec1956 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -149,15 +149,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; |