sim: cpu: change default init to handle all cpus

All the runtimes were only initializing a single CPU.  When SMP is
enabled, things quickly crash as none of the other CPU structs are
setup.  Change the default from 0 to the compile time value.
This commit is contained in:
Mike Frysinger
2022-12-25 00:53:25 -05:00
parent fc9b044582
commit 883be19774
28 changed files with 32 additions and 27 deletions

View File

@@ -77,7 +77,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
callback->syscall_map = cb_riscv_syscall_map;
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all_extra (sd, 1, sizeof (struct riscv_sim_cpu))
if (sim_cpu_alloc_all_extra (sd, 0, sizeof (struct riscv_sim_cpu))
!= SIM_RC_OK)
{
free_state (sd);