From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id A5A60395A008 for ; Mon, 8 Feb 2021 04:08:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A5A60395A008 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 25ED433BDD0 for ; Mon, 8 Feb 2021 04:08:37 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 0/3] [RFC] sim: framework for self-declaring initializers Date: Sun, 7 Feb 2021 23:08:30 -0500 Message-Id: <20210208040833.7455-1-vapier@gentoo.org> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 08 Feb 2021 04:08:41 -0000 GDB has a framework where modules can declare funcs with names that start with "_initialize" and they'll automatically get called during startup. Bring that same framework idea to the sim so we can stop hardcoding callbacks in a centralized location. This is the rough basis for it with a few modules converted over as an example. I couldn't find much info in the GDB side to show that this is the wrong direction to go. Feedback welcome. Mike Frysinger (3): sim: add framework for declaring init callbacks locally sim: dv-sockser: localize init callback sim: bfin: move option inits to respective modules sim/bfin/dv-bfin_mmu.c | 12 ++++++++++- sim/bfin/interp.c | 11 ---------- sim/bfin/machs.c | 12 ++++++++++- sim/common/Make-common.in | 24 +++++++++++++++++++++- sim/common/dv-sockser.c | 5 ++++- sim/common/dv-sockser.h | 2 -- sim/common/sim-module.c | 42 +++++++++++++++++++++++++-------------- sim/common/sim-module.h | 1 + 8 files changed, 77 insertions(+), 32 deletions(-) -- 2.30.0