From patchwork Tue Dec 5 04:46:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81332 Return-Path: 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 7DAFE388217B for ; Tue, 5 Dec 2023 04:47:46 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id A82293858D33 for ; Tue, 5 Dec 2023 04:47:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A82293858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A82293858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751653; cv=none; b=q/4vDF2xkRYQyz7RGHIqew9h5FK7cSGJb55au1lSLRDsY0CDcHq01Vph8h6yTsMXigEwxpkHTT4ia7kZ0wX8M7Lr91mJkPEQwCE4hyIJeH8ii9bvHftz/ACGYd8GwrN6ENqhWqpQieD46FAUDoQOcMyAbfEkd55RKefYcvi7ZBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751653; c=relaxed/simple; bh=TkMBa9yJTGWr/t6Zlna6C4HmqDckCUS/jxOXuJ5gDIw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Hw2iCEIoaMUISS19svp131lhUJjknf+wG21UCbDTxcRTH/jiBkrDV91MEE4wUsZkTydgq+ZRPPzIEurO9G7YGq039F8PbesbeZBiT2mb8HHa9kpwsvJAMDJ75pCDo7vpmtVtS8TG4Pd4fjtNYBAKovbg/ACx67atfZlH77p5fMs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id EA8AD335D6E; Tue, 5 Dec 2023 04:47:22 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 1/3 committed] sim: ppc: cleanup getrusage decls Date: Mon, 4 Dec 2023 23:46:14 -0500 Message-ID: <20231205044616.4000-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Don't conflate HAVE_GETRUSAGE & HAVE_SYS_RESOURCE_H. Use the latter to include the header and nothing else. Use the former to determine whether to use the function and nothing else. If we find a system that doesn't follow POSIX and provides only one of these, we can figure out how to support it then. The manual local definition is clashing with the system ones and leading to build failures with newer C standards. sim/ppc/emul_netbsd.c:51:5: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype] --- sim/ppc/emul_netbsd.c | 9 +-------- sim/ppc/emul_unix.c | 9 +-------- sim/ppc/mon.c | 1 - 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index 51f8e98ae32b..950f1f4a696a 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -40,15 +40,8 @@ #include "emul_generic.h" #include "emul_netbsd.h" -#ifdef HAVE_GETRUSAGE -#ifndef HAVE_SYS_RESOURCE_H -#undef HAVE_GETRUSAGE -#endif -#endif - -#ifdef HAVE_GETRUSAGE +#ifdef HAVE_SYS_RESOURCE_H #include -int getrusage(); #endif #if HAVE_SYS_IOCTL_H diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index be9e8385f526..88f6e3abc0a2 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -87,15 +87,8 @@ #include #endif -#ifdef HAVE_GETRUSAGE -#ifndef HAVE_SYS_RESOURCE_H -#undef HAVE_GETRUSAGE -#endif -#endif - -#ifdef HAVE_GETRUSAGE +#ifdef HAVE_SYS_RESOURCE_H #include -int getrusage(); #endif #if HAVE_DIRENT_H diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c index 8ab42af84589..8bbabe6e50d4 100644 --- a/sim/ppc/mon.c +++ b/sim/ppc/mon.c @@ -36,7 +36,6 @@ #ifdef HAVE_SYS_RESOURCE_H #include -int getrusage(); #endif #include "basics.h" From patchwork Tue Dec 5 04:46:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81331 Return-Path: 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 756B73882073 for ; Tue, 5 Dec 2023 04:47:46 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id C582D3858433 for ; Tue, 5 Dec 2023 04:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C582D3858433 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C582D3858433 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751653; cv=none; b=GW8mC2wPZk2+7AL/FU4VChK8A9IlyjTIRAc4tr0kxOJOg46lSl89+AyudWz+YPS4izh0/bRaZ2NJt026c7meyCugnNDaoDgWgMkXvvaOfliU8wYMi4bgnIaJEP1z5YVDGwvZDFyRBfW10zQszTNs9Vr56oqDDA9uffKsM339Th4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751653; c=relaxed/simple; bh=4eK1bY0r7JsqY/Mf7GjY+20ym+QwDRAp1MWBoCX9Jgw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=FuO91tucWnCqQ/vdHFJf8PIoCy+tmpovEG47ctjzwh/WJorwTXDrAde57oMfo47+Z3ErVyG980eEjv8USijf1qzVZLNL8JkM0NhjnkDUYAuSEJEiXaj8hrU6CM1xnzJvYJ+nwPF8jtbqBcr8r5848vDl2t6CKTq/5I0LGe3pVqg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 03A9E335D76; Tue, 5 Dec 2023 04:47:25 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 2/3 committed] sim: ppc: fix -Wmisleading-indentation warnings Date: Mon, 4 Dec 2023 23:46:15 -0500 Message-ID: <20231205044616.4000-2-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205044616.4000-1-vapier@gentoo.org> References: <20231205044616.4000-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Fix building with -Wmisleading-indentation. --- sim/ppc/igen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 445afb9ee00d..8aa19c757f59 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -233,7 +233,7 @@ gen_semantics_c(insn_table *table, lf_printf(file, " option_mpc860c0 = 0;\n"); lf_printf(file, " if (tree_find_property(root, \"/options/mpc860c0\"))\n"); lf_printf(file, " option_mpc860c0 = tree_find_integer_property(root, \"/options/mpc860c0\");\n"); - lf_printf(file, " option_mpc860c0 *= 4; /* convert word count to byte count */\n"); + lf_printf(file, " option_mpc860c0 *= 4; /* convert word count to byte count */\n"); lf_printf(file, "}\n"); lf_printf(file, "\n"); if (generate_expanded_instructions) From patchwork Tue Dec 5 04:46:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81333 Return-Path: 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 E1D113889830 for ; Tue, 5 Dec 2023 04:48:01 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 3A6C438582B6 for ; Tue, 5 Dec 2023 04:47:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A6C438582B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A6C438582B6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751658; cv=none; b=psWMykMDm8gq0Q1YljiCgWevUmVrboMVjAK4n7LyN2ocbG+YnASCdqdMgwZB2pAU7O+4YBAabgis0pQjA2LmJVQdG7rid+TdTGrH9fR6I7QgMd6SHT0Bjh2zOSRGGlJ6eBhF2nv3IR++8b6Qavb2i47uAhSGlj+8uIzsam7k/GM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751658; c=relaxed/simple; bh=82FvsvmX6QKkbe61wX9iifXgmcPtSdAP6GWEQiRkT1Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=hDzZMeOxt64Qo9sJE8sKV1ZmBPuMa1oMfQIaatUzcSawKcEQeoMAXzW4M62Iqs7Ho/cW9RCs+e/7KANtLvq/1kqlU9TRXztDj/1nVrdyoAwIqxxQu4Nx+SLMXQhTokWLMgaLYQHB6LYZy9BDrCWyl+lM9ZHDHTu8ZXV3xuOkXyY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 0D206335D7B; Tue, 5 Dec 2023 04:47:27 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 3/3 committed] sim: ppc: fix implicit enum conversion Date: Mon, 4 Dec 2023 23:46:16 -0500 Message-ID: <20231205044616.4000-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205044616.4000-1-vapier@gentoo.org> References: <20231205044616.4000-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This code tries to use attach_type enums as hw_phb_decode, and while they're setup to have compatible values, the compiler doesn't like it when the cast is missing. So cast it explicitly and then use that. sim/ppc/hw_phb.c:322:28: error: implicit conversion from enumeration type 'attach_type' (aka 'enum _attach_type') to different enumeration type 'hw_phb_decode' [-Werror,-Wenum-conversion] --- sim/ppc/hw_phb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sim/ppc/hw_phb.c b/sim/ppc/hw_phb.c index a3c192642351..ec1119ee7d9b 100644 --- a/sim/ppc/hw_phb.c +++ b/sim/ppc/hw_phb.c @@ -303,6 +303,7 @@ hw_phb_attach_address(device *me, { hw_phb_device *phb = device_data(me); phb_space *pci_space; + hw_phb_decode phb_type = (hw_phb_decode)type; /* sanity checks */ if (space < 0 || space >= nr_hw_phb_spaces) device_error(me, "attach space (%d) specified by %s invalid", @@ -312,14 +313,13 @@ hw_phb_attach_address(device *me, || addr < pci_space->my_base) device_error(me, "attach addr (0x%lx) specified by %s outside of bus address range", (unsigned long)addr, device_path(client)); - if ((hw_phb_decode)type != hw_phb_normal_decode - && (hw_phb_decode)type != hw_phb_subtractive_decode) + if (phb_type != hw_phb_normal_decode && phb_type != hw_phb_subtractive_decode) device_error(me, "attach type (%d) specified by %s invalid", type, device_path(client)); /* attach it to the relevent bus */ DTRACE(phb, ("attach %s - %s %s:0x%lx (0x%lx bytes)\n", device_path(client), - hw_phb_decode_name(type), + hw_phb_decode_name(phb_type), pci_space->name, (unsigned long)addr, (unsigned long)nr_bytes));