diff options
Diffstat (limited to 'sim/common/sim-base.h')
-rw-r--r-- | sim/common/sim-base.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h index f7a33cd9f4b..0dae541094c 100644 --- a/sim/common/sim-base.h +++ b/sim/common/sim-base.h @@ -44,11 +44,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ struct sim_state { sim_cpu *cpu[MAX_NR_PROCESSORS]; - #if (WITH_SMP) - #define STATE_CPU(sd,n) ((sd)->cpu[n]) - #else - #define STATE_CPU(sd,n) ((sd)->cpu[0]) - #endif ... simulator specific members ... sim_state_base base; }; @@ -116,6 +111,15 @@ extern struct sim_state *current_state; #endif +/* We require all sims to dynamically allocate cpus. See comment up top about + struct sim_state. */ +#if (WITH_SMP) +# define STATE_CPU(sd, n) ((sd)->cpu[n]) +#else +# define STATE_CPU(sd, n) ((sd)->cpu[0]) +#endif + + typedef struct { /* Simulator's argv[0]. */ |