+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_open): Call sim_state_alloc_extra.
+ * sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Define.
+ (struct sim_state): Delete.
+ (STATE_BOARD_DATA): Define.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* bfin-sim.c, devices.c, dv-bfin_cec.c, dv-bfin_ctimer.c,
{
char c;
int i;
- SIM_DESC sd = sim_state_alloc (kind, callback);
+ SIM_DESC sd = sim_state_alloc_extra (kind, callback,
+ sizeof (struct bfin_board_data));
/* The cpu data is kept in a separately allocated chunk of memory. */
if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
#ifndef _BFIN_MAIN_SIM_H_
#define _BFIN_MAIN_SIM_H_
+#define SIM_HAVE_COMMON_SIM_STATE
+
#include "sim-basics.h"
#include "sim-signal.h"
#include "arch.h"
};
#define BFIN_CPU_STATE ((cpu)->state)
-struct sim_state {
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- /* ... simulator specific members ... */
- struct bfin_board_data board;
-#define STATE_BOARD_DATA(sd) (&(sd)->board)
- sim_state_base base;
-};
+#define STATE_BOARD_DATA(sd) ((struct bfin_board_data *) STATE_ARCH_DATA (sd))
#include "sim-config.h"
#include "sim-types.h"