sim: msp430: move arch-specific settings to internal header
authorMike Frysinger <vapier@gentoo.org>
Fri, 23 Dec 2022 03:47:10 +0000 (22:47 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 23 Dec 2022 13:32:58 +0000 (08:32 -0500)
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the msp430-sim.h include and move it to
the few files that actually need it.

While we're here, drop redundant includes from sim-main.h:
* sim-config.h & sim-types.h included by sim-basics.h already
* sim-engine.h included by sim-base.h already
And move sim-options.h to the one file that needs it.

sim/msp430/msp430-sim.c
sim/msp430/msp430-sim.h
sim/msp430/sim-main.h

index a13a0fe044a517ca717420573519facf2d749e64..d402be77eb4011c29b4bf4e7b3a5959787b47323 100644 (file)
 #include <assert.h>
 #include "opcode/msp430-decode.h"
 #include "sim-main.h"
+#include "sim-options.h"
 #include "sim-signal.h"
 #include "sim-syscall.h"
+#include "msp430-sim.h"
 
 static sim_cia
 msp430_pc_fetch (SIM_CPU *cpu)
index 96af91d44163b21638485e0d2cff6f4e158eaae1..e0933e58d1df7a966b522e865ceffe806b227c35 100644 (file)
@@ -46,4 +46,6 @@ struct msp430_cpu_state
 
 #define HWMULT(sd, field) MSP430_SIM_CPU (STATE_CPU (sd, 0))->field
 
+#define MSP430_SIM_CPU(cpu) ((struct msp430_cpu_state *) CPU_ARCH_DATA (cpu))
+
 #endif
index 5603d411df7b0e82beca9679494d1312c3bfa318..92fce3cfbb9da8a1166ae66efca4f1aa62c26e48 100644 (file)
 #define _MSP430_MAIN_SIM_H_
 
 #include "sim-basics.h"
-#include "msp430-sim.h"
 #include "sim-base.h"
 
-#define MSP430_SIM_CPU(cpu) ((struct msp430_cpu_state *) CPU_ARCH_DATA (cpu))
-
-#include "sim-config.h"
-#include "sim-types.h"
-#include "sim-engine.h"
-#include "sim-options.h"
-
 #endif /* _MSP430_MAIN_SIM_H_ */