From 883be197745c9a9ea626cf0671e8bb0109d21a36 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 25 Dec 2022 00:53:25 -0500 Subject: 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. --- sim/example-synacor/interp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sim/example-synacor') diff --git a/sim/example-synacor/interp.c b/sim/example-synacor/interp.c index 20ae057..25e519d 100644 --- a/sim/example-synacor/interp.c +++ b/sim/example-synacor/interp.c @@ -90,7 +90,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, current_target_byte_order = BFD_ENDIAN_LITTLE; /* The cpu data is kept in a separately allocated chunk of memory. */ - if (sim_cpu_alloc_all_extra (sd, 1, sizeof (struct example_sim_cpu)) + if (sim_cpu_alloc_all_extra (sd, 0, sizeof (struct example_sim_cpu)) != SIM_RC_OK) { free_state (sd); -- cgit v1.1