From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +ACaJn3YzmC6fQAAWB0awg (envelope-from ) for ; Sun, 20 Jun 2021 01:56:13 -0400 Received: by simark.ca (Postfix, from userid 112) id 9C1F21F163; Sun, 20 Jun 2021 01:56:13 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 C47F11E01F for ; Sun, 20 Jun 2021 01:56:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CC1C3857C6B for ; Sun, 20 Jun 2021 05:56:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CC1C3857C6B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624168572; bh=FaZsiJQTL9RXgrTjO4cmrqzg4AItiRoysEaXerk7pWI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=g42XdWKvkIefvf4nzuI+SoCy6gvB9MFTGtJ7B6ogKE/WTXOxPalpOIQzNvmejIlln ZAuuKT0WrkKs9+piiXKY+AOCqnUYAYHnrzS9nUrfCxXGjsPOqaYJk1DEQIzzlXtr4m L/XkyWnC/LFWilE11LC/XGPoUuYl6yNQfHLskkpI= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 007953857C51 for ; Sun, 20 Jun 2021 05:55:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 007953857C51 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 3781533E01A for ; Sun, 20 Jun 2021 05:55:24 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 5/5] sim: hw: move cfi & glue to common code Date: Sun, 20 Jun 2021 01:55:19 -0400 Message-Id: <20210620055519.22229-5-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210620055519.22229-1-vapier@gentoo.org> References: <20210620055519.22229-1-vapier@gentoo.org> 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" These don't depend on any arch state, so move them to the common build code so we only build them once across all subdirs. --- sim/Makefile.in | 61 +++++++++++++++++++++++++++++++-------- sim/common/Make-common.in | 8 +++-- sim/common/dv-cfi.c | 2 +- sim/common/hw-base.h | 2 ++ sim/common/local.mk | 6 ++++ 5 files changed, 63 insertions(+), 16 deletions(-) diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 4bf1e2e21e27..2701462ba096 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -216,7 +216,8 @@ BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH) COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS) -SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES) +SIM_HW_DEVICES = core pal $(SIM_EXTRA_HW_DEVICES) +SIM_HW_DEVICES_COMMON = cfi glue ZLIB = $(zlibdir) -lz LIBIBERTY_LIB = ../../libiberty/libiberty.a @@ -228,6 +229,7 @@ EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \ $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) COMMON_OBJS_NAMES = \ + $(SIM_HW_DEVICES_COMMON:%=dv-%.o) \ portability.o \ sim-load.o \ version.o @@ -419,12 +421,12 @@ hw-config.h: stamp-hw ; @true stamp-hw: Makefile.in $(srccom)/Make-common.in $(config.status) Makefile rm -f tmp-hw.h echo "/* generated by Makefile */" > tmp-hw.h - sim_hw="$(SIM_HW_DEVICES)"; \ + sim_hw="$(SIM_HW_DEVICES) $(SIM_HW_DEVICES_COMMON)"; \ for hw in $$sim_hw ; do \ echo "extern const struct hw_descriptor dv_$${hw}_descriptor[];" ; \ done >> tmp-hw.h echo "const struct hw_descriptor *hw_descriptors[] = {" >> tmp-hw.h - sim_hw="$(SIM_HW_DEVICES)"; \ + sim_hw="$(SIM_HW_DEVICES) $(SIM_HW_DEVICES_COMMON)"; \ for hw in $$sim_hw ; do \ echo " dv_$${hw}_descriptor," ; \ done >> tmp-hw.h diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c index 02a2cedd558b..008a3904771b 100644 --- a/sim/common/dv-cfi.c +++ b/sim/common/dv-cfi.c @@ -34,10 +34,10 @@ #include #endif -#include "sim-main.h" #include "hw-base.h" #include "hw-main.h" #include "dv-cfi.h" +#include "libiberty.h" /* Flashes are simple state machines, so here we cover all the different states a device might be in at any particular time. */ diff --git a/sim/common/hw-base.h b/sim/common/hw-base.h index f1cf989357b7..6980834c6874 100644 --- a/sim/common/hw-base.h +++ b/sim/common/hw-base.h @@ -23,6 +23,8 @@ #ifndef HW_BASE #define HW_BASE +struct sim_state; + /* Create a primative device */ struct hw *hw_create diff --git a/sim/common/local.mk b/sim/common/local.mk index 25c7e5beb1f9..bc562c6e5e5e 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -38,6 +38,12 @@ noinst_LIBRARIES += %D%/libcommon.a %D%/sim-load.c \ %D%/version.c +if SIM_ENABLE_HW +%C%_libcommon_a_SOURCES += \ + %D%/dv-cfi.c \ + %D%/dv-glue.c +endif + %D%/version.c: %D%/version.c-stamp ; @true %D%/version.c-stamp: $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcdir)/%D%/create-version.sh $(AM_V_GEN)$(SHELL) $(srcdir)/%D%/create-version.sh $(srcroot)/gdb $@.tmp -- 2.31.1