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

@@ -168,7 +168,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
current_target_byte_order = BFD_ENDIAN_BIG;
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all_extra (sd, 1, sizeof (struct or1k_sim_cpu))
if (sim_cpu_alloc_all_extra (sd, 0, sizeof (struct or1k_sim_cpu))
!= SIM_RC_OK)
{
free_state (sd);