[3/3] sim: split sim-signal.h include out

Message ID 20210616063302.20722-3-vapier@gentoo.org
State New
Headers show
Series
  • [1/3] sim: split sim/callback.h include out
Related show

Commit Message

Weimin Pan via Gdb-patches June 16, 2021, 6:33 a.m.
The sim-basics.h is too big and includes too many things.  This leads
to some arch's sim-main.h having circular loop issues with defs, and
makes it hard to separate out common objects from arch-specific defs.
By splitting up sim-basics.h and killing off sim-main.h, it'll make
it easier to separate out the two.
---
 sim/aarch64/cpustate.c         | 1 +
 sim/aarch64/memory.c           | 1 +
 sim/aarch64/simulator.c        | 2 ++
 sim/avr/interp.c               | 1 +
 sim/bfin/dv-bfin_cec.c         | 1 +
 sim/bfin/sim-main.h            | 1 -
 sim/bpf/bpf.c                  | 1 +
 sim/common/cgen-run.c          | 1 +
 sim/common/cgen-utils.c        | 1 +
 sim/common/nrun.c              | 1 +
 sim/common/sim-basics.h        | 1 -
 sim/common/sim-core.c          | 1 +
 sim/common/sim-engine.c        | 1 +
 sim/common/sim-reason.c        | 1 +
 sim/common/sim-resume.c        | 1 +
 sim/common/sim-signal.c        | 1 +
 sim/common/sim-stop.c          | 1 +
 sim/common/sim-watch.c         | 1 +
 sim/cr16/interp.c              | 1 +
 sim/cr16/simops.c              | 1 +
 sim/cris/traps.c               | 1 +
 sim/d10v/interp.c              | 1 +
 sim/d10v/simops.c              | 1 +
 sim/example-synacor/sim-main.c | 1 +
 sim/frv/interrupts.c           | 1 +
 sim/frv/traps.c                | 1 +
 sim/ft32/interp.c              | 1 +
 sim/h8300/compile.c            | 1 +
 sim/iq2000/iq2000.c            | 1 +
 sim/lm32/traps.c               | 1 +
 sim/m32r/traps-linux.c         | 1 +
 sim/m32r/traps.c               | 1 +
 sim/m68hc11/dv-m68hc11eepr.c   | 1 +
 sim/m68hc11/interrupts.c       | 1 +
 sim/m68hc11/m68hc11_sim.c      | 1 +
 sim/m68hc11/sim-main.h         | 2 +-
 sim/mcore/interp.c             | 1 +
 sim/microblaze/interp.c        | 1 +
 sim/mips/interp.c              | 1 +
 sim/mn10300/interp.c           | 1 +
 sim/mn10300/mn10300_sim.h      | 1 +
 sim/mn10300/op_utils.c         | 1 +
 sim/mn10300/sim-main.h         | 1 -
 sim/moxie/interp.c             | 1 +
 sim/msp430/msp430-sim.c        | 1 +
 sim/msp430/sim-main.h          | 1 -
 sim/or1k/traps.c               | 1 +
 sim/ppc/sim-main.h             | 1 -
 sim/pru/interp.c               | 1 +
 sim/riscv/sim-main.c           | 1 +
 sim/v850/simops.c              | 1 +
 51 files changed, 47 insertions(+), 6 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/aarch64/cpustate.c b/sim/aarch64/cpustate.c
index 6007d74872d1..45a08623f955 100644
--- a/sim/aarch64/cpustate.c
+++ b/sim/aarch64/cpustate.c
@@ -26,6 +26,7 @@ 
 #include <math.h>
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "cpustate.h"
 #include "simulator.h"
 #include "libiberty.h"
diff --git a/sim/aarch64/memory.c b/sim/aarch64/memory.c
index 22caf617074d..cd2df334da56 100644
--- a/sim/aarch64/memory.c
+++ b/sim/aarch64/memory.c
@@ -33,6 +33,7 @@ 
 #include "simulator.h"
 
 #include "sim-core.h"
+#include "sim-signal.h"
 
 static inline void
 mem_error (sim_cpu *cpu, const char *message, uint64_t addr)
diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c
index be1c2987636a..0970aceda9f2 100644
--- a/sim/aarch64/simulator.c
+++ b/sim/aarch64/simulator.c
@@ -34,6 +34,8 @@ 
 #include "cpustate.h"
 #include "memory.h"
 
+#include "sim-signal.h"
+
 #define NO_SP 0
 #define SP_OK 1
 
diff --git a/sim/avr/interp.c b/sim/avr/interp.c
index 1626fadaa973..7cb17a0d44f0 100644
--- a/sim/avr/interp.c
+++ b/sim/avr/interp.c
@@ -29,6 +29,7 @@ 
 #include "sim-main.h"
 #include "sim-base.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 
 /* As AVR is a 8/16 bits processor, define handy types.  */
 typedef unsigned short int word;
diff --git a/sim/bfin/dv-bfin_cec.c b/sim/bfin/dv-bfin_cec.c
index e80616d15d15..7ad3ea068006 100644
--- a/sim/bfin/dv-bfin_cec.c
+++ b/sim/bfin/dv-bfin_cec.c
@@ -24,6 +24,7 @@ 
 #include <strings.h>
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "devices.h"
 #include "dv-bfin_cec.h"
 #include "dv-bfin_evt.h"
diff --git a/sim/bfin/sim-main.h b/sim/bfin/sim-main.h
index 18d0a00e0d64..0e5d1856621a 100644
--- a/sim/bfin/sim-main.h
+++ b/sim/bfin/sim-main.h
@@ -22,7 +22,6 @@ 
 #define _BFIN_MAIN_SIM_H_
 
 #include "sim-basics.h"
-#include "sim-signal.h"
 #include "arch.h"
 #include "sim-base.h"
 
diff --git a/sim/bpf/bpf.c b/sim/bpf/bpf.c
index f9cdb824d1a9..9e78960ddcc5 100644
--- a/sim/bpf/bpf.c
+++ b/sim/bpf/bpf.c
@@ -24,6 +24,7 @@ 
 
 #include "sim-main.h"
 #include "sim-fpu.h"
+#include "sim-signal.h"
 #include "cgen-mem.h"
 #include "cgen-ops.h"
 #include "cpuall.h"
diff --git a/sim/common/cgen-run.c b/sim/common/cgen-run.c
index 9420942af8ad..1b097e1f1ec8 100644
--- a/sim/common/cgen-run.c
+++ b/sim/common/cgen-run.c
@@ -38,6 +38,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 
 #ifndef SIM_ENGINE_PREFIX_HOOK
 #define SIM_ENGINE_PREFIX_HOOK(sd)
diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c
index 13107904678c..529d80dfb15c 100644
--- a/sim/common/cgen-utils.c
+++ b/sim/common/cgen-utils.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "bfd.h"
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "dis-asm.h"
 
 #define MEMOPS_DEFINE_INLINE
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index ba293d1ce736..3fd78346f957 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -23,6 +23,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <string.h>
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim/callback.h"
 
 #include "bfd.h"
diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h
index a3dd5d93d584..32995a870d13 100644
--- a/sim/common/sim-basics.h
+++ b/sim/common/sim-basics.h
@@ -121,7 +121,6 @@  typedef enum {
 #include "sim-types.h"
 #include "sim-bits.h"
 #include "sim-endian.h"
-#include "sim-signal.h"
 
 #include "sim-utils.h"
 
diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c
index 6604f31ea97b..2c568dc3e364 100644
--- a/sim/common/sim-core.c
+++ b/sim/common/sim-core.c
@@ -28,6 +28,7 @@ 
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 #include "libiberty.h"
 
 #if (WITH_HW)
diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c
index a5f84af2801b..83f41f07deb7 100644
--- a/sim/common/sim-engine.c
+++ b/sim/common/sim-engine.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/sim/common/sim-reason.c b/sim/common/sim-reason.c
index 73a57654c246..fa3683793d2d 100644
--- a/sim/common/sim-reason.c
+++ b/sim/common/sim-reason.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 
 #include <stdlib.h>
 
diff --git a/sim/common/sim-resume.c b/sim/common/sim-resume.c
index 8f854da84751..93b198aed056 100644
--- a/sim/common/sim-resume.c
+++ b/sim/common/sim-resume.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 
 /* Halt the simulator after just one instruction */
 
diff --git a/sim/common/sim-signal.c b/sim/common/sim-signal.c
index f9fef4c24c64..d51860438240 100644
--- a/sim/common/sim-signal.c
+++ b/sim/common/sim-signal.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <signal.h>
 #include "sim-main.h"
+#include "sim-signal.h"
 
 /* Convert SIM_SIGFOO to SIGFOO.
    What to do when the host doesn't have SIGFOO is handled on a case by case
diff --git a/sim/common/sim-stop.c b/sim/common/sim-stop.c
index aa48fc3e6f36..076d43d81019 100644
--- a/sim/common/sim-stop.c
+++ b/sim/common/sim-stop.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 
 /* Generic implementation of sim_stop.  */
 
diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c
index fa035b380549..bc6c44bcfd17 100644
--- a/sim/common/sim-watch.c
+++ b/sim/common/sim-watch.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 #include "libiberty.h"
 
 #include "sim-assert.h"
diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c
index 7f6b07fe286a..54536a4a23d1 100644
--- a/sim/cr16/interp.c
+++ b/sim/cr16/interp.c
@@ -30,6 +30,7 @@ 
 
 #include "sim-main.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 
 #include "gdb/sim-cr16.h"
 #include "gdb/signals.h"
diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c
index b383dfa1f926..afd870e595fa 100644
--- a/sim/cr16/simops.c
+++ b/sim/cr16/simops.c
@@ -32,6 +32,7 @@ 
 #include <sys/time.h>
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "simops.h"
 #include "targ-vals.h"
 
diff --git a/sim/cris/traps.c b/sim/cris/traps.c
index 2ad408139d83..130a38053d1f 100644
--- a/sim/cris/traps.c
+++ b/sim/cris/traps.c
@@ -24,6 +24,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-main.h"
 #include "sim-syscall.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 #include "sim/callback.h"
 #include "bfd.h"
 /* FIXME: get rid of targ-vals.h usage everywhere else.  */
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index c0cdc034700d..c48e39a27d6b 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -9,6 +9,7 @@ 
 
 #include "sim-main.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 
 #include "gdb/sim-d10v.h"
 #include "gdb/signals.h"
diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c
index af725ad9bb99..64c888c4c429 100644
--- a/sim/d10v/simops.c
+++ b/sim/d10v/simops.c
@@ -11,6 +11,7 @@ 
 #include <string.h>
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "simops.h"
 #include "targ-vals.h"
 
diff --git a/sim/example-synacor/sim-main.c b/sim/example-synacor/sim-main.c
index d7a68b38bf46..ccefe1b759b5 100644
--- a/sim/example-synacor/sim-main.c
+++ b/sim/example-synacor/sim-main.c
@@ -25,6 +25,7 @@ 
 #include "defs.h"
 
 #include "sim-main.h"
+#include "sim-signal.h"
 
 /* Get the register number from the number.  */
 static unsigned16
diff --git a/sim/frv/interrupts.c b/sim/frv/interrupts.c
index a657c68e2417..99b27cffa948 100644
--- a/sim/frv/interrupts.c
+++ b/sim/frv/interrupts.c
@@ -24,6 +24,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define WANT_CPU_FRVBF
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "bfd.h"
 #include <stdlib.h>
 
diff --git a/sim/frv/traps.c b/sim/frv/traps.c
index 91b424fc7e1e..46cb8d92f29e 100644
--- a/sim/frv/traps.c
+++ b/sim/frv/traps.c
@@ -28,6 +28,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "cgen-engine.h"
 #include "cgen-par.h"
 #include "sim-fpu.h"
+#include "sim-signal.h"
 #include "sim/callback.h"
 
 #include "bfd.h"
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index 8a44a472f605..be2c3e55aff4 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -33,6 +33,7 @@ 
 
 #include "sim-main.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 
 #include "opcode/ft32.h"
 
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 8b13326a0a9c..3f637ff5bfe5 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -33,6 +33,7 @@ 
 #include "sys/stat.h"
 #include "sys/types.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 #include "sim/callback.h"
 
 #ifndef SIGTRAP
diff --git a/sim/iq2000/iq2000.c b/sim/iq2000/iq2000.c
index 018c6a63a3f3..362cc4acb192 100644
--- a/sim/iq2000/iq2000.c
+++ b/sim/iq2000/iq2000.c
@@ -24,6 +24,7 @@ 
 #define WANT_CPU_IQ2000BF
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "cgen-mem.h"
 #include "cgen-ops.h"
 #include "targ-vals.h"
diff --git a/sim/lm32/traps.c b/sim/lm32/traps.c
index 5b010f9d3fed..77b4accef4ee 100644
--- a/sim/lm32/traps.c
+++ b/sim/lm32/traps.c
@@ -25,6 +25,7 @@ 
 #define WANT_CPU_LM32BF
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "lm32-sim.h"
 #include "targ-vals.h"
diff --git a/sim/m32r/traps-linux.c b/sim/m32r/traps-linux.c
index 1e3a08497e90..8ff046590d40 100644
--- a/sim/m32r/traps-linux.c
+++ b/sim/m32r/traps-linux.c
@@ -22,6 +22,7 @@ 
 
 #include "portability.h"
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "syscall.h"
 #include "targ-vals.h"
diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c
index ffa09f1527f0..4cec5c0d45ce 100644
--- a/sim/m32r/traps.c
+++ b/sim/m32r/traps.c
@@ -21,6 +21,7 @@ 
 #include "defs.h"
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "targ-vals.h"
 #include <stdlib.h>
diff --git a/sim/m68hc11/dv-m68hc11eepr.c b/sim/m68hc11/dv-m68hc11eepr.c
index 1e4cb5eab054..ac67bf9e76aa 100644
--- a/sim/m68hc11/dv-m68hc11eepr.c
+++ b/sim/m68hc11/dv-m68hc11eepr.c
@@ -25,6 +25,7 @@ 
 #include "hw-main.h"
 #include "sim-assert.h"
 #include "sim-events.h"
+#include "sim-signal.h"
 
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/sim/m68hc11/interrupts.c b/sim/m68hc11/interrupts.c
index 1adce5082190..e6a9d7399727 100644
--- a/sim/m68hc11/interrupts.c
+++ b/sim/m68hc11/interrupts.c
@@ -22,6 +22,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 
 static const char *interrupt_names[] = {
   "R1",
diff --git a/sim/m68hc11/m68hc11_sim.c b/sim/m68hc11/m68hc11_sim.c
index 3c619c14ab0b..bdf69e2ac2c2 100644
--- a/sim/m68hc11/m68hc11_sim.c
+++ b/sim/m68hc11/m68hc11_sim.c
@@ -24,6 +24,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-assert.h"
 #include "sim-module.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 
 #include <stdlib.h>
 
diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h
index 18a7426011b0..a48d7f4c8f1d 100644
--- a/sim/m68hc11/sim-main.h
+++ b/sim/m68hc11/sim-main.h
@@ -21,7 +21,6 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #define _SIM_MAIN_H
 
 #include "sim-basics.h"
-#include "sim-signal.h"
 #include "sim-base.h"
 
 #include "bfd.h"
@@ -30,6 +29,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim/sim.h"
 #include "opcode/m68hc11.h"
+#include "sim-signal.h"
 #include "sim-types.h"
 
 typedef unsigned8 uint8;
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index 3517068abf5b..138dcccea4d3 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -32,6 +32,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "sim-main.h"
 #include "sim-base.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "sim-options.h"
 
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index e451f2d68d14..94f50f1e4cd9 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -30,6 +30,7 @@ 
 
 #include "sim-main.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 
 #include "microblaze-dis.h"
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index a6f504acc764..4ab908d4f7a0 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -31,6 +31,7 @@  code on the hardware.
 #include "sim-options.h"
 #include "sim-assert.h"
 #include "sim-hw.h"
+#include "sim-signal.h"
 
 #include "itable.h"
 
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index 541d4b14668c..c79ce0155340 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -9,6 +9,7 @@ 
 
 #include "bfd.h"
 #include "sim-assert.h"
+#include "sim-signal.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/sim/mn10300/mn10300_sim.h b/sim/mn10300/mn10300_sim.h
index c63efaa6c769..7a0d857cc58e 100644
--- a/sim/mn10300/mn10300_sim.h
+++ b/sim/mn10300/mn10300_sim.h
@@ -7,6 +7,7 @@ 
 #include "sim/sim.h"
 #include "bfd.h"
 #include "sim-fpu.h"
+#include "sim-signal.h"
 
 extern SIM_DESC simulator;
 
diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c
index cd0f1a667e49..df95be3b1ac4 100644
--- a/sim/mn10300/op_utils.c
+++ b/sim/mn10300/op_utils.c
@@ -2,6 +2,7 @@ 
 #include "defs.h"
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "targ-vals.h"
 
diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h
index 875072941839..101586e5c70d 100644
--- a/sim/mn10300/sim-main.h
+++ b/sim/mn10300/sim-main.h
@@ -25,7 +25,6 @@ 
 #define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) /* disable this hook */
 
 #include "sim-basics.h"
-#include "sim-signal.h"
 
 #include <signal.h> /* For kill() in insns:do_trap */
 
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index caf9e43deda5..8f3a85ca16d7 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -34,6 +34,7 @@  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-base.h"
 #include "sim-options.h"
 #include "sim-io.h"
+#include "sim-signal.h"
 #include "targ-vals.h"
 
 typedef int word;
diff --git a/sim/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index 58a54698993f..4f270a099da1 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -30,6 +30,7 @@ 
 #include <assert.h>
 #include "opcode/msp430-decode.h"
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "targ-vals.h"
 
diff --git a/sim/msp430/sim-main.h b/sim/msp430/sim-main.h
index fdfa5d094560..68910046997b 100644
--- a/sim/msp430/sim-main.h
+++ b/sim/msp430/sim-main.h
@@ -22,7 +22,6 @@ 
 #define _MSP430_MAIN_SIM_H_
 
 #include "sim-basics.h"
-#include "sim-signal.h"
 #include "msp430-sim.h"
 #include "sim-base.h"
 
diff --git a/sim/or1k/traps.c b/sim/or1k/traps.c
index bb428fa4a886..91f0d2bdd136 100644
--- a/sim/or1k/traps.c
+++ b/sim/or1k/traps.c
@@ -23,6 +23,7 @@ 
 #define WANT_CPU
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "cgen-ops.h"
 
 /* Implement the sim invalid instruction function.  This will set the error
diff --git a/sim/ppc/sim-main.h b/sim/ppc/sim-main.h
index 1e565c119ed4..047b36cbce4b 100644
--- a/sim/ppc/sim-main.h
+++ b/sim/ppc/sim-main.h
@@ -1,5 +1,4 @@ 
 #include "sim-basics.h"
-#include "sim-signal.h"
 
 typedef unsigned32 sim_cia;
 
diff --git a/sim/pru/interp.c b/sim/pru/interp.c
index 38269df44ce7..194022d486de 100644
--- a/sim/pru/interp.c
+++ b/sim/pru/interp.c
@@ -31,6 +31,7 @@ 
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-options.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 #include "pru.h"
 
diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c
index a09ae033cac2..0faf9395ae52 100644
--- a/sim/riscv/sim-main.c
+++ b/sim/riscv/sim-main.c
@@ -28,6 +28,7 @@ 
 #include <time.h>
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "sim-syscall.h"
 
 #include "opcode/riscv.h"
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index 800a5904ea44..6a111044f652 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -2,6 +2,7 @@ 
 #include "defs.h"
 
 #include "sim-main.h"
+#include "sim-signal.h"
 #include "v850_sim.h"
 #include "simops.h"