From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MsvdNzebyWA5fwAAWB0awg (envelope-from ) for ; Wed, 16 Jun 2021 02:33:27 -0400 Received: by simark.ca (Postfix, from userid 112) id D3DB01F163; Wed, 16 Jun 2021 02:33:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D4B861E813 for ; Wed, 16 Jun 2021 02:33:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 51B253986801 for ; Wed, 16 Jun 2021 06:33:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51B253986801 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623825206; bh=iFVsnfg4QeyguChdZAVbTOmdyRGcXha97ktNJgdw6GA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Md24nm0GIMq/Zq32kPmwNDM8SfP/v5ZTDFO7fRt+OFVHSdc+aWkcB20HS6xVYJpPK CIXyVTw+ASzwhNXagaYSQg6V8RiATspC+a7/Cg/tYKdmM10HamyWXcyhvLVEU74157 PQ/PePUYYqcIHXVnLQCS6a1+J7R/lhGTYHhNALpU= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id EF0E73894411 for ; Wed, 16 Jun 2021 06:33:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF0E73894411 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 368FD335D35 for ; Wed, 16 Jun 2021 06:33:05 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 1/3] sim: split sim/callback.h include out Date: Wed, 16 Jun 2021 02:33:00 -0400 Message-Id: <20210616063302.20722-1-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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. --- sim/common/cgen-trace.c | 1 + sim/common/nrun.c | 1 + sim/common/sim-basics.h | 1 - sim/common/sim-endian.h | 1 + sim/common/sim-hw.c | 1 + sim/common/sim-io.c | 1 + sim/common/sim-syscall.c | 1 + sim/common/sim-syscall.h | 2 ++ sim/common/sim-trace.c | 1 + sim/common/sim-utils.h | 1 + sim/cris/traps.c | 1 + sim/frv/traps.c | 1 + sim/h8300/compile.c | 1 + sim/m68hc11/sim-main.h | 1 - 14 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 66250c09be75..206720ca1395 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -26,6 +26,7 @@ along with this program. If not, see . */ #include "bfd.h" #include "sim-main.h" #include "sim-fpu.h" +#include "sim/callback.h" #ifndef SIZE_INSTRUCTION #define SIZE_INSTRUCTION 16 diff --git a/sim/common/nrun.c b/sim/common/nrun.c index e39a0c6ed546..ba293d1ce736 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -23,6 +23,7 @@ along with this program. If not, see . */ #include #include "sim-main.h" +#include "sim/callback.h" #include "bfd.h" #include "environ.h" diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h index ac63aef456ac..13547422d3c3 100644 --- a/sim/common/sim-basics.h +++ b/sim/common/sim-basics.h @@ -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" diff --git a/sim/common/sim-endian.h b/sim/common/sim-endian.h index 6e9101fa3f02..7b663a3375ce 100644 --- a/sim/common/sim-endian.h +++ b/sim/common/sim-endian.h @@ -23,6 +23,7 @@ #ifndef SIM_ENDIAN_H #define SIM_ENDIAN_H +#include "bfd.h" /* C byte conversion functions */ diff --git a/sim/common/sim-hw.c b/sim/common/sim-hw.c index 95d95042ded4..9a3db171d1b3 100644 --- a/sim/common/sim-hw.c +++ b/sim/common/sim-hw.c @@ -23,6 +23,7 @@ along with this program. If not, see . */ #include "sim-main.h" #include "sim-assert.h" #include "sim-options.h" +#include "sim/callback.h" #include "sim-hw.h" diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c index b5e874bef794..e09a4af7ba2e 100644 --- a/sim/common/sim-io.c +++ b/sim/common/sim-io.c @@ -24,6 +24,7 @@ #include "sim-main.h" #include "sim-io.h" +#include "sim/callback.h" #include "targ-vals.h" #include diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c index 0f7601cafd73..be3ff8f82e2c 100644 --- a/sim/common/sim-syscall.c +++ b/sim/common/sim-syscall.c @@ -24,6 +24,7 @@ #include "sim-main.h" #include "sim-syscall.h" +#include "sim/callback.h" #include "targ-vals.h" /* Read/write functions for system call interface. */ diff --git a/sim/common/sim-syscall.h b/sim/common/sim-syscall.h index 6f79d9dfce96..562f443cb99a 100644 --- a/sim/common/sim-syscall.h +++ b/sim/common/sim-syscall.h @@ -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. diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c index b8224e0b8346..2c3798933db3 100644 --- a/sim/common/sim-trace.c +++ b/sim/common/sim-trace.c @@ -24,6 +24,7 @@ along with this program. If not, see . */ #include "sim-io.h" #include "sim-options.h" #include "sim-fpu.h" +#include "sim/callback.h" #include "bfd.h" #include "libiberty.h" diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h index 9cc19f5567bc..bfc8ac72d08e 100644 --- a/sim/common/sim-utils.h +++ b/sim/common/sim-utils.h @@ -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, diff --git a/sim/cris/traps.c b/sim/cris/traps.c index a55f7dfb9927..2ad408139d83 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -24,6 +24,7 @@ along with this program. If not, see . */ #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. */ diff --git a/sim/frv/traps.c b/sim/frv/traps.c index d5cab2496226..91b424fc7e1e 100644 --- a/sim/frv/traps.c +++ b/sim/frv/traps.c @@ -28,6 +28,7 @@ along with this program. If not, see . */ #include "cgen-engine.h" #include "cgen-par.h" #include "sim-fpu.h" +#include "sim/callback.h" #include "bfd.h" #include "libiberty.h" diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 01e9766790c8..8b13326a0a9c 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/callback.h" #ifndef SIGTRAP # define SIGTRAP 5 diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h index 955c69fb38d4..18a7426011b0 100644 --- a/sim/m68hc11/sim-main.h +++ b/sim/m68hc11/sim-main.h @@ -28,7 +28,6 @@ along with this program. If not, see . */ #include "opcode/m68hc11.h" -#include "sim/callback.h" #include "sim/sim.h" #include "opcode/m68hc11.h" #include "sim-types.h" -- 2.31.1