]> 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>
Thu, 10 Nov 2022 18:44:20 +0000 (01:44 +0700)
commit39764277cc9f7e246937d73d3ec2e950ea9a1256
tree42f412e7d2bd88b9456fbd47983ad8d66ebab3af
parent35c15263671f3af0e6237c24c017c186208f7cbf
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