[PATCH 00/20] sim: reduce sim-main.h pollution

Mike Frysinger via Gdb-patches
2022-12-23T06:07:47Z

The sim-main.h header is supposed to be a minimal interface between
the port and the common code to define the sim_state & sim_cpu data
structures. Unfortunately it has grown over time to include a lot
more stuff for each port, so it's turned into a bit of a dumping
ground.

The sim_state & sim_cpu logic has been split out & unified at this
point, so this header no longer needs to provide nearly as much as
it historically has. That isn't to say it's completely unused at
this point, but in order to get a better grip on what's left, move
unnecessary logic now out of each port's sim-main.h.

For most non-cgen ports, this header is reduced to the bare min:
including sim-basics.h & sim-base.h and nothing else.

Mike Frysinger (20):
sim: avr: move arch-specific settings to internal header
sim: aarch64: move arch-specific settings to internal header
sim: arm: move arch-specific settings to internal header
sim: cr16: move arch-specific settings to internal header
sim: d10v: move arch-specific settings to internal header
sim: ft32: move arch-specific settings to internal header
sim: msp430: move arch-specific settings to internal header
sim: v850: standardize the arch-specific settings a little
sim: riscv: move arch-specific settings to internal header
sim: moxie: move arch-specific settings to internal header
sim: example-synacor: move arch-specific settings to internal header
sim: microblaze: move arch-specific settings to internal header
sim: mn10300: standardize the arch-specific settings a little
sim: pru: move arch-specific settings to internal header
sim: h8300: move arch-specific settings to internal header
sim: mcore: move arch-specific settings to internal header
sim: sh: move arch-specific settings to internal header
sim: m68hc11: move arch-specific settings to internal header
sim: bfin: move arch-specific settings to internal header
sim: m32r: move arch-specific settings to internal header

sim/aarch64/aarch64-sim.h | 60 ++
sim/aarch64/cpustate.c | 2 +
sim/aarch64/cpustate.h | 1 +
sim/aarch64/interp.c | 2 +
sim/aarch64/sim-main.h | 35 -
sim/aarch64/simulator.c | 1 +
sim/arm/arm-sim.h | 26 +
sim/arm/armdefs.h | 6 +
sim/arm/armemu.h | 2 +
sim/arm/sim-main.h | 5 -
sim/arm/wrapper.c | 1 +
sim/avr/avr-sim.h | 41 ++
sim/avr/interp.c | 1 +
sim/avr/sim-main.h | 18 -
sim/bfin/bfin-sim.c | 2 +
sim/bfin/bfin-sim.h | 29 +
sim/bfin/devices.h | 2 +
sim/bfin/dv-bfin_pll.c | 1 -
sim/bfin/interp.c | 3 +
sim/bfin/machs.c | 3 +
sim/bfin/sim-main.h | 36 -
sim/cr16/{cr16_sim.h => cr16-sim.h} | 1 +
sim/cr16/gencode.c | 3 +-
sim/cr16/interp.c | 2 +
sim/cr16/sim-main.h | 2 -
sim/cr16/simops.c | 2 +
sim/d10v/{d10v_sim.h => d10v-sim.h} | 5 +
sim/d10v/endian.c | 4 +-
sim/d10v/gencode.c | 3 +-
sim/d10v/interp.c | 2 +
sim/d10v/sim-main.h | 2 -
sim/d10v/simops.c | 2 +
sim/example-synacor/example-synacor-sim.h | 38 +
sim/example-synacor/interp.c | 2 +
sim/example-synacor/sim-main.c | 2 +
sim/example-synacor/sim-main.h | 14 -
sim/ft32/interp.c | 2 +
sim/ft32/sim-main.h | 2 -
sim/h8300/compile.c | 2 +
sim/h8300/h8300-sim.h | 153 ++++
sim/h8300/sim-main.h | 147 ----
sim/m32r/m32r-sim.h | 22 +
sim/m32r/m32r.c | 2 +
sim/m32r/m32r2.c | 2 +
sim/m32r/m32rx.c | 2 +
sim/m32r/sim-if.c | 1 +
sim/m32r/sim-main.h | 24 +-
sim/m32r/traps.c | 2 +
sim/m68hc11/dv-m68hc11.c | 2 +
sim/m68hc11/dv-m68hc11eepr.c | 2 +-
sim/m68hc11/dv-m68hc11sio.c | 1 +
sim/m68hc11/dv-m68hc11spi.c | 1 +
sim/m68hc11/dv-m68hc11tim.c | 2 +
sim/m68hc11/dv-nvram.c | 1 +
sim/m68hc11/emulos.c | 2 +
sim/m68hc11/gencode.c | 2 +-
sim/m68hc11/interp.c | 2 +
sim/m68hc11/interrupts.c | 2 +
sim/m68hc11/m68hc11-sim.h | 565 +++++++++++++++
sim/m68hc11/m68hc11_sim.c | 4 +-
sim/m68hc11/sim-main.h | 541 --------------
sim/mcore/interp.c | 2 +
sim/mcore/mcore-sim.h | 64 ++
sim/mcore/sim-main.h | 40 -
sim/microblaze/interp.c | 1 +
sim/microblaze/microblaze-sim.h | 46 ++
sim/microblaze/sim-main.h | 24 -
sim/mn10300/interp.c | 2 -
sim/mn10300/{mn10300_sim.h => mn10300-sim.h} | 24 +-
sim/mn10300/op_utils.c | 10 +-
sim/mn10300/sim-main.h | 34 +-
sim/moxie/interp.c | 2 +
sim/moxie/moxie-sim.h | 34 +
sim/moxie/sim-main.h | 11 -
sim/msp430/msp430-sim.c | 2 +
sim/msp430/msp430-sim.h | 2 +
sim/msp430/sim-main.h | 8 -
sim/pru/pru.h | 56 ++
sim/pru/sim-main.h | 58 --
sim/riscv/interp.c | 2 +
sim/riscv/machs.c | 1 +
sim/riscv/riscv-sim.h | 78 ++
sim/riscv/sim-main.c | 2 +
sim/riscv/sim-main.h | 55 --
sim/sh/interp.c | 2 +
sim/sh/sh-sim.h | 118 +++
sim/sh/sim-main.h | 96 ---
sim/v850/interp.c | 2 +-
sim/v850/sim-main.h | 721 +-----------------
sim/v850/simops.c | 2 +-
sim/v850/simops.h | 3 +
sim/v850/v850-sim.h | 722 +++++++++++++++++++
sim/v850/v850_sim.h | 8 -
93 files changed, 2190 insertions(+), 1891 deletions(-)
create mode 100644 sim/aarch64/aarch64-sim.h
create mode 100644 sim/arm/arm-sim.h
create mode 100644 sim/avr/avr-sim.h
rename sim/cr16/{cr16_sim.h => cr16-sim.h} (99%)
rename sim/d10v/{d10v_sim.h => d10v-sim.h} (99%)
create mode 100644 sim/example-synacor/example-synacor-sim.h
create mode 100644 sim/h8300/h8300-sim.h
create mode 100644 sim/m68hc11/m68hc11-sim.h
create mode 100644 sim/mcore/mcore-sim.h
create mode 100644 sim/microblaze/microblaze-sim.h
rename sim/mn10300/{mn10300_sim.h => mn10300-sim.h} (94%)
create mode 100644 sim/moxie/moxie-sim.h
create mode 100644 sim/riscv/riscv-sim.h
create mode 100644 sim/sh/sh-sim.h
create mode 100644 sim/v850/v850-sim.h
delete mode 100644 sim/v850/v850_sim.h

--
2.39.0