]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
sim: sim_cpu: invert sim_cpu storage
authorMike Frysinger <vapier@gentoo.org>
Fri, 12 Aug 2016 15:43:27 +0000 (23:43 +0800)
committerMike Frysinger <vapier@gentoo.org>
Wed, 21 Dec 2022 04:57:38 +0000 (23:57 -0500)
commitffeb72b44c8c5060465005178dd3a4a304117a58
treeb44abd51ce73b4207664c3570fb0a834668aff65
parentd026e67ed41a249ec758847008d8a19257bf45fc
sim: sim_cpu: invert sim_cpu storage

Currently all ports have to declare sim_cpu themselves in their
sim-main.h and then embed the common sim_cpu_base 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_cpu, and
the port uses the new arch_data field for its per-cpu state.

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.  This includes mn10300 that,
while it defines custom fields in its cpu struct, never uses them.
sim/arm/sim-main.h
sim/common/sim-cpu.c
sim/common/sim-cpu.h
sim/cr16/sim-main.h
sim/d10v/sim-main.h
sim/mn10300/sim-main.h
sim/sh/sim-main.h