From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id V8fKCxvWy2ADOQAAWB0awg (envelope-from ) for ; Thu, 17 Jun 2021 19:09:15 -0400 Received: by simark.ca (Postfix, from userid 112) id 204BF1F163; Thu, 17 Jun 2021 19:09:15 -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 DBF0B1E813 for ; Thu, 17 Jun 2021 19:09:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B3B4399C020 for ; Thu, 17 Jun 2021 23:09:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B3B4399C020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623971353; bh=7zh7Rwm4eB5jZhusCzXh05IBz6v854wAailKHhuzrGo=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XVX2UHiHUZFeb+3HEDar6SeN3bOjFyhH6W73tI/THH+/B0RoX18HDuJBeIkuuBFxh SLT/+F3kBM082LHfcPLgg2Jv6qcQTGvztqf4VcOhH5irmGKiw4BuuUIIgtHWD8IbEc dFuBoI2fr4B4y2TFTPZrwLjAxljL6KuJ0CWxT5e4= Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 17A04399C03D; Thu, 17 Jun 2021 23:07:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17A04399C03D Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 469DF33BE58; Thu, 17 Jun 2021 23:06:59 +0000 (UTC) Date: Thu, 17 Jun 2021 19:06:57 -0400 To: "CHIGOT, CLEMENT" Subject: Re: sim/ppc PAGE_SIZE redefinition Message-ID: Mail-Followup-To: "CHIGOT, CLEMENT" , Nick Clifton , binutils@sourceware.org, gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Cc: Nick Clifton , gdb-patches@sourceware.org, binutils@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 17 Jun 2021 12:00, CHIGOT, CLEMENT via Binutils wrote: > > > I'm not able to build "sim/ppc" anymore on AIX. > > > > The sim sources are part of gdb, not the binutils ... > > Oh, I wasn't aware of that. > Note that it's still being built even when --disable-gdb is provided > to the configure. > > >> or is it safe to > >> rename it PAGE_SIZE_1k or something like that ? > > > > It really depends upon how the simulator sources are going to use the constant. > > But it would probably be best if the value used inside the simulator matched > > the system value.  That way you are unlikely to run into host-vs-sim emulation > > issues.  All of which is a fancy to way to say that the best solutions is > > probably to patch semantics.h to only define PAGE_SIZE if it is not already > > defined. > > That's what I've done locally. But I don't know anything about sim. The tests > on AIX aren't even building. On linux/ppc64le, it seems ok though. I can > submit the patch, but I want to be sure that this is the correct way to fix that. the PAGE_SIZE here has no relationship to the host system. it's just used for a single cpu hardware quirk. so we can safely rename it to anything else. -mike >From a49dd19e81deb6d6c4af0fcadd94be1574f0b7dc Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 17 Jun 2021 19:03:32 -0400 Subject: [PATCH] sim: ppc: avoid "PAGE_SIZE" name This define is used for a particular target and depends on the simulated CPU hardware. It has no relation to the host CPU that the sim is running on. So rename the common "PAGE_SIZE" here to better reflect its usage and avoid conflicts with system headers. --- sim/ppc/ChangeLog | 5 +++++ sim/ppc/igen.c | 2 +- sim/ppc/ppc-instructions | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 05178aa427b5..280234af869e 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2021-06-17 Mike Frysinger + + * igen.c (gen_semantics_h): Rename PAGE_SIZE to MPC860C0_PAGE_SIZE. + * ppc-instructions: Likewise. + 2021-06-16 Mike Frysinger * configure.ac: Delete AC_EXEEXT call. diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 0bf3b58ca26d..f0ff06b31c41 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -182,7 +182,7 @@ gen_semantics_h(insn_table *table, lf_printf(file, "\n"); if ((code & generate_calls)) { lf_printf(file, "extern int option_mpc860c0;\n"); - lf_printf(file, "#define PAGE_SIZE 0x1000\n"); + lf_printf(file, "#define MPC860C0_PAGE_SIZE 0x1000\n"); lf_printf(file, "\n"); lf_printf(file, "PSIM_EXTERN_SEMANTICS(void)\n"); lf_printf(file, "semantic_init(device* root);\n"); diff --git a/sim/ppc/ppc-instructions b/sim/ppc/ppc-instructions index 70aa04e2210e..2278b6263765 100644 --- a/sim/ppc/ppc-instructions +++ b/sim/ppc/ppc-instructions @@ -1537,7 +1537,7 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, If this is a forward branch and it is near the end of a page, we've detected a problematic branch. */ if (succeed && NIA > CIA) { - if (PAGE_SIZE - (CIA & (PAGE_SIZE-1)) <= option_mpc860c0) + if (MPC860C0_PAGE_SIZE - (CIA & (MPC860C0_PAGE_SIZE-1)) <= option_mpc860c0) program_interrupt(processor, cia, mpc860c0_instruction_program_interrupt); } } @@ -1579,7 +1579,7 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, If this is a forward branch and it is near the end of a page, we've detected a problematic branch. */ if (succeed && NIA > CIA) { - if (PAGE_SIZE - (CIA & (PAGE_SIZE-1)) <= option_mpc860c0) + if (MPC860C0_PAGE_SIZE - (CIA & (MPC860C0_PAGE_SIZE-1)) <= option_mpc860c0) program_interrupt(processor, cia, mpc860c0_instruction_program_interrupt); } } @@ -1610,7 +1610,7 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, If this is a forward branch and it is near the end of a page, we've detected a problematic branch. */ if (succeed && NIA > CIA) { - if (PAGE_SIZE - (CIA & (PAGE_SIZE-1)) <= option_mpc860c0) + if (MPC860C0_PAGE_SIZE - (CIA & (MPC860C0_PAGE_SIZE-1)) <= option_mpc860c0) program_interrupt(processor, cia, mpc860c0_instruction_program_interrupt); } } -- 2.31.1