diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-21 21:00:25 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-17 00:42:55 -0400 |
commit | 383861bd08c47a160f54351e6b8519140b9aad8e (patch) | |
tree | dc43aadd66fbcc1f7cf18d8bebd7b14740086e48 /sim/sh/sim-main.h | |
parent | 92bc001e1f91390b8e009c29e75f4e8b9be02d76 (diff) | |
download | gdb-383861bd08c47a160f54351e6b8519140b9aad8e.zip gdb-383861bd08c47a160f54351e6b8519140b9aad8e.tar.gz 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/sh/sim-main.h')
-rw-r--r-- | sim/sh/sim-main.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sim/sh/sim-main.h b/sim/sh/sim-main.h index 090b0ac..58c1436 100644 --- a/sim/sh/sim-main.h +++ b/sim/sh/sim-main.h @@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define SIM_HAVE_COMMON_SIM_STATE + #include "sim-basics.h" #include "sim-base.h" @@ -131,11 +133,4 @@ struct _sim_cpu { sim_cpu_base base; }; -struct sim_state { - - sim_cpu *cpu[MAX_NR_PROCESSORS]; - - sim_state_base base; -}; - #endif |