aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-21 21:05:33 -0500
committerMike Frysinger <vapier@gentoo.org>2021-05-17 00:43:45 -0400
commit85d93de3d8e24b54516ece8ec95ab09e6786e102 (patch)
treea3058306292cfc6eefcacc652691ecbe9043d55a
parent383861bd08c47a160f54351e6b8519140b9aad8e (diff)
downloadgdb-85d93de3d8e24b54516ece8ec95ab09e6786e102.zip
gdb-85d93de3d8e24b54516ece8ec95ab09e6786e102.tar.gz
gdb-85d93de3d8e24b54516ece8ec95ab09e6786e102.tar.bz2
sim: bfin: invert sim_state storage
-rw-r--r--sim/bfin/ChangeLog7
-rw-r--r--sim/bfin/interp.c3
-rw-r--r--sim/bfin/sim-main.h11
3 files changed, 12 insertions, 9 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index c9b64b1..d5c55e0 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,3 +1,10 @@
+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,
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index 8e3a121..3435720 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -717,7 +717,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
{
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)
diff --git a/sim/bfin/sim-main.h b/sim/bfin/sim-main.h
index a09ea49..855a178 100644
--- a/sim/bfin/sim-main.h
+++ b/sim/bfin/sim-main.h
@@ -21,6 +21,8 @@
#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"
@@ -37,14 +39,7 @@ struct _sim_cpu {
};
#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"