Message ID | 3904a5c3e80f8548150d8088a92059dd728c7ff8.1666258361.git.research_trasio@irq.a4lg.com |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66D4C38CE996 for <patchwork@sourceware.org>; Thu, 20 Oct 2022 09:36:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66D4C38CE996 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258560; bh=wSc7GsQVfWfQxciF0C3o8qc3GaZdVuMxvyAiY+Il5HY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qesNRn3FL1evzaa5LM1rRwpsqF+9f85yyrV0Al1CCPMyH23DYDbHMGpjNO+PHIMr1 oBS0P9w9Tfn/QLUM2m8XyiVcDdyaN6tOPMfRT5vH9z1bJPlGaJD8Mrx6g6MpSe5wVp R4YhpwRWkMTUIdZSeik4UjMT+0qD9t91kYTBNmLU= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id A4AA53830382 for <gdb-patches@sourceware.org>; Thu, 20 Oct 2022 09:33:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4AA53830382 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 0343F300089; Thu, 20 Oct 2022 09:33:56 +0000 (UTC) To: Tsukasa OI <research_trasio@irq.a4lg.com>, Andrew Burgess <aburgess@redhat.com>, Mike Frysinger <vapier@gentoo.org>, Nick Clifton <nickc@redhat.com> Subject: [PATCH 06/40] sim/cris: Move declarations of f_specific_init Date: Thu, 20 Oct 2022 09:32:11 +0000 Message-Id: <3904a5c3e80f8548150d8088a92059dd728c7ff8.1666258361.git.research_trasio@irq.a4lg.com> In-Reply-To: <cover.1666258361.git.research_trasio@irq.a4lg.com> References: <cover.1666258361.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tsukasa OI via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tsukasa OI <research_trasio@irq.a4lg.com> Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
sim+gdb: Suppress warnings if built with Clang (big batch 1)
|
|
Commit Message
Tsukasa OI
Oct. 20, 2022, 9:32 a.m. UTC
Declarations for MY (f_specific_init) functions are defined in CGEN- generated header files: sim/cris/decodev10.h (crisv10f_specific_init) and sim/cris/decodev32.h (crisv32f_specific_init). However, those declarations are manually added by the commit 4e6e8ba7c565 ("sim: cris: clean up missing func prototype warnings") as a hack and not a CGEN-generated part. Those definitions are required by $(builddir)/sim/cris/mloopv{10,32}f.c, generated from $(srcdir)/sim/cris/mloop.in. If we define a declaration in mloop.in, we no longer need manually added one. This commit adds a template for function declaration so that we no longer have to touch CGEN-generated code. With this and the previous commit "cpu/cris: Add stall unit to CRIS v32", we can now safely regenerate CRIS CPU declarations with CGEN. --- sim/cris/cris-tmpl.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 20 Oct 2022 09:32, Tsukasa OI wrote: > Declarations for MY (f_specific_init) functions are defined in CGEN- > generated header files: sim/cris/decodev10.h (crisv10f_specific_init) and > sim/cris/decodev32.h (crisv32f_specific_init). However, those declarations > are manually added by the commit 4e6e8ba7c565 ("sim: cris: clean up missing > func prototype warnings") as a hack and not a CGEN-generated part. > > Those definitions are required by $(builddir)/sim/cris/mloopv{10,32}f.c, > generated from $(srcdir)/sim/cris/mloop.in. If we define a declaration in > mloop.in, we no longer need manually added one. > > This commit adds a template for function declaration so that we no longer > have to touch CGEN-generated code. With this and the previous commit > "cpu/cris: Add stall unit to CRIS v32", we can now safely regenerate > CRIS CPU declarations with CGEN. > --- > sim/cris/cris-tmpl.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c > index 9f0c06e755e..8694d38b2af 100644 > --- a/sim/cris/cris-tmpl.c > +++ b/sim/cris/cris-tmpl.c > @@ -264,6 +264,8 @@ MY (make_thread_cpu_data) (SIM_CPU *current_cpu, void *context) > > /* Hook function for per-cpu simulator initialization. */ > > +extern void MY (f_specific_init) (SIM_CPU *); > + > void > MY (f_specific_init) (SIM_CPU *current_cpu) > { putting the prototype here means function definition & function usage can fall out of sync and not get any compile error. that's why it has to be in a header that both places include. cris uses cris-sim.h for non-standard funcs like this (e.g. break_handler), so the specific_init prototypes should be moved there too. -mike
diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c index 9f0c06e755e..8694d38b2af 100644 --- a/sim/cris/cris-tmpl.c +++ b/sim/cris/cris-tmpl.c @@ -264,6 +264,8 @@ MY (make_thread_cpu_data) (SIM_CPU *current_cpu, void *context) /* Hook function for per-cpu simulator initialization. */ +extern void MY (f_specific_init) (SIM_CPU *); + void MY (f_specific_init) (SIM_CPU *current_cpu) {