]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: split sim/callback.h include out
authorMike Frysinger <vapier@gentoo.org>
Mon, 14 Jun 2021 02:14:40 +0000 (22:14 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 17 Jun 2021 04:11:48 +0000 (00:11 -0400)
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.

Start with splitting out sim/callback.h.

19 files changed:
sim/common/ChangeLog
sim/common/cgen-trace.c
sim/common/nrun.c
sim/common/sim-basics.h
sim/common/sim-endian.h
sim/common/sim-hw.c
sim/common/sim-io.c
sim/common/sim-syscall.c
sim/common/sim-syscall.h
sim/common/sim-trace.c
sim/common/sim-utils.h
sim/cris/ChangeLog
sim/cris/traps.c
sim/frv/ChangeLog
sim/frv/traps.c
sim/h8300/ChangeLog
sim/h8300/compile.c
sim/m68hc11/ChangeLog
sim/m68hc11/sim-main.h

index 60b94cf06ebe4f8c5cbb3ab6b2c5409c19900ebb..abb2ec6799523f42a41691e28e62b0152b449b88 100644 (file)
@@ -1,3 +1,12 @@
+2021-06-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * cgen-trace.c: Include sim/callback.h.
+       * nrun.c, sim-hw.c, sim-io.c, sim-syscall.c, sim-trace.c: Likewise.
+       * sim-basics.h: Delete sim/callback.h include.
+       * sim-endian.h: Include bfd.h.
+       * sim-syscall.h (struct cb_syscall): New forward decl.
+       * sim-utils.h (sim_analyze_program): Likewise.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
        * Make-common.in (CONFIG_CFLAGS): Change @DEFS@ to -DHAVE_CONFIG_H.
index 66250c09be751b6816d8db5337b31a833a793fe7..206720ca13957d3ee7a44bfec261160928c7a885 100644 (file)
@@ -26,6 +26,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "bfd.h"
 #include "sim-main.h"
 #include "sim-fpu.h"
+#include "sim/callback.h"
 
 #ifndef SIZE_INSTRUCTION
 #define SIZE_INSTRUCTION 16
index e39a0c6ed54638882cbb2beea34ddd19d17f5e06..ba293d1ce73677cf7ab721dcdbffcbcc18931bff 100644 (file)
@@ -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/callback.h"
 
 #include "bfd.h"
 #include "environ.h"
index ac63aef456ac9dfe90ffbd459ac0d5b627cf233c..13547422d3c37b5b29901954c60904c9a723f950 100644 (file)
@@ -112,7 +112,6 @@ typedef enum {
 /* Basic definitions - ordered so that nothing calls what comes after it.  */
 
 #include "ansidecl.h"
-#include "sim/callback.h"
 #include "sim/sim.h"
 
 #include "sim-config.h"
index 6e9101fa3f026b81637c3cd6109635164bfe3b71..7b663a3375ce8c28d68ca7d8bc9e9cf3a14dd8b2 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef SIM_ENDIAN_H
 #define SIM_ENDIAN_H
 
+#include "bfd.h"
 
 /* C byte conversion functions */
 
index 95d95042ded4c7a3bf0274834f2261ebdd1e2ef0..9a3db171d1b3d884d3f6339556a83243ebe0aa54 100644 (file)
@@ -23,6 +23,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-main.h"
 #include "sim-assert.h"
 #include "sim-options.h"
+#include "sim/callback.h"
 
 #include "sim-hw.h"
 
index b5e874bef794f479cf6aa919c162c2072ad91947..e09a4af7ba2e4dd66935971d09ab874b4914b47a 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "sim-main.h"
 #include "sim-io.h"
+#include "sim/callback.h"
 #include "targ-vals.h"
 
 #include <errno.h>
index 0f7601cafd73474f129d66e2cc6d3824876a2785..be3ff8f82e2c7de3eb955e4ab1981d09f07aeb68 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "sim-main.h"
 #include "sim-syscall.h"
+#include "sim/callback.h"
 #include "targ-vals.h"
 \f
 /* Read/write functions for system call interface.  */
index 6f79d9dfce965bb6c4bd9d9ee40339472a95c79b..562f443cb99ab738f3ea7ee3b0ad675fbe6b8d56 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef SIM_SYSCALL_H
 #define SIM_SYSCALL_H
 
+struct cb_syscall;
+
 /* Perform a syscall on the behalf of the target program.  The error/result are
    normalized into a single value (like a lot of operating systems do).  If you
    want the split values, see the other function below.
index b8224e0b8346b71aa3195e53b76884d3af1daf54..2c3798933db34fc724c56c96aaf9c3dda8af5bc3 100644 (file)
@@ -24,6 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sim-io.h"
 #include "sim-options.h"
 #include "sim-fpu.h"
+#include "sim/callback.h"
 
 #include "bfd.h"
 #include "libiberty.h"
index 9cc19f5567bcf59c4ad7187b2c34bf7e33412972..bfc8ac72d08eb0d8975fadacf0bd882452869c1a 100644 (file)
@@ -60,6 +60,7 @@ SIM_RC sim_analyze_program (SIM_DESC sd, const char *prog_name,
    write the program sections at LMA interpreted as a virtual address.
    This is still accommodated for backward compatibility reasons. */
 
+typedef struct host_callback_struct host_callback;
 typedef int sim_write_fn (SIM_DESC sd, SIM_ADDR mem,
                          const unsigned char *buf, int length);
 struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
index 60a5ce1c94e9af0031df21fcb7677ac411aae146..24084199f734daa1659851870c2492bc49d07741 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * traps.c: Include sim/callback.h.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index a55f7dfb99274112a4ced09a58cceff58d4ab4c7..2ad408139d830e1f85d52a26730e698d90208231 100644 (file)
@@ -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/callback.h"
 #include "bfd.h"
 /* FIXME: get rid of targ-vals.h usage everywhere else.  */
 
index f5038cbf1f358b3f737cb17ef9b3b5d9858b790f..80b33cd6d8eb50255051b93eff487a5db2a508bb 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * traps.c: Include sim/callback.h.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index d5cab2496226e4767282b692852693f23c45c2e8..91b424fc7e1e7c648887417be0d69bdfc1a2c254 100644 (file)
@@ -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/callback.h"
 
 #include "bfd.h"
 #include "libiberty.h"
index 1d506ffc4192f626de72e6798dd8bf5e6eff921f..e12242ccd3b77b79a305aed2ffc93158f7418688 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * compile.c: Include sim/callback.h.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 01e9766790c8b6dd64068006c9d240d8bd0d9a80..8b13326a0a9c2fa45c3f6b45c281b682159026fd 100644 (file)
@@ -33,6 +33,7 @@
 #include "sys/stat.h"
 #include "sys/types.h"
 #include "sim-options.h"
+#include "sim/callback.h"
 
 #ifndef SIGTRAP
 # define SIGTRAP 5
index 5b757d067d9e2ab57c89cd2984f1e43bb57ebe46..0c1aa1146e8d99933682f738557a2dc979cdfef0 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h: Delete sim/callback.h include.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 955c69fb38d4cf9028b771b122d00d87121bb433..18a7426011b01bb564ea72a24e2ddc0b6bc54131 100644 (file)
@@ -28,7 +28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "opcode/m68hc11.h"
 
-#include "sim/callback.h"
 #include "sim/sim.h"
 #include "opcode/m68hc11.h"
 #include "sim-types.h"