aboutsummaryrefslogtreecommitdiff
path: root/sim/mn10300
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-21 21:00:25 -0500
committerMike Frysinger <vapier@gentoo.org>2021-05-17 00:42:55 -0400
commit383861bd08c47a160f54351e6b8519140b9aad8e (patch)
treedc43aadd66fbcc1f7cf18d8bebd7b14740086e48 /sim/mn10300
parent92bc001e1f91390b8e009c29e75f4e8b9be02d76 (diff)
downloadfsf-binutils-gdb-383861bd08c47a160f54351e6b8519140b9aad8e.zip
fsf-binutils-gdb-383861bd08c47a160f54351e6b8519140b9aad8e.tar.gz
fsf-binutils-gdb-383861bd08c47a160f54351e6b8519140b9aad8e.tar.bz2
sim: invert sim_state storage
Currently all ports have to declare sim_state themselves in their sim-main.h and then embed the common sim_state_base & sim_cpu in it. This dynamic makes it impossible to share common object code among multiple ports because the core data structure is always different. Let's invert this relationship: common code declares sim_state, and if the port actually needs state on a per-instance basis, it can use the new arch_data field for it. Most ports don't actually use it, so they don't need to declare anything at all. This is the first in a series of changes: it adds a define to select between the old & new layouts, then converts all the ports that don't need custom state over to the new layout.
Diffstat (limited to 'sim/mn10300')
-rw-r--r--sim/mn10300/ChangeLog5
-rw-r--r--sim/mn10300/sim-main.h13
2 files changed, 7 insertions, 11 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index 92dd6d1..75a447d 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Define.
+ (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* dv-mn103cpu.c, dv-mn103int.c, dv-mn103iop.c, dv-mn103ser.c,
diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h
index 5b3e593..5bf068b 100644
--- a/sim/mn10300/sim-main.h
+++ b/sim/mn10300/sim-main.h
@@ -22,6 +22,8 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
+#define SIM_HAVE_COMMON_SIM_STATE
+
#define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) 0 /* disable this hook */
#include "sim-basics.h"
@@ -65,17 +67,6 @@ struct _sim_cpu {
sim_cpu_base base;
};
-
-struct sim_state {
-
- /* the processors proper */
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- /* The base class. */
- sim_state_base base;
-
-};
-
/* For compatibility, until all functions converted to passing
SIM_DESC as an argument */
extern SIM_DESC simulator;