From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 394D0385736E for ; Tue, 1 Nov 2022 16:27:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 394D0385736E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id DDD9C34101E; Tue, 1 Nov 2022 16:27:09 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 22/27] sim: iq2000: invert sim_cpu storage Date: Tue, 1 Nov 2022 20:56:53 +0545 Message-Id: <20221101151158.24916-23-vapier@gentoo.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221101151158.24916-1-vapier@gentoo.org> References: <20221101151158.24916-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The cpu.h change is in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically. --- sim/iq2000/cpu.h | 2 +- sim/iq2000/sim-main.h | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sim/iq2000/cpu.h b/sim/iq2000/cpu.h index a204eeb0e350..0a9aa802f117 100644 --- a/sim/iq2000/cpu.h +++ b/sim/iq2000/cpu.h @@ -61,7 +61,7 @@ CPU (h_gr[(index)]) = (x);\ }\ ;} while (0) } hardware; -#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware) +#define CPU_CGEN_HW(cpu) (& IQ2000_SIM_CPU (cpu)->cpu_data.hardware) } IQ2000BF_CPU_DATA; /* Cover fns for register access. */ diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h index bf0608290884..bb927fcf57c5 100644 --- a/sim/iq2000/sim-main.h +++ b/sim/iq2000/sim-main.h @@ -4,6 +4,8 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define SIM_HAVE_COMMON_SIM_CPU + /* This is a global setting. Different cpu families can't mix-n-match -scache and -pbb. However some cpu families may use -simple while others use one of -scache/-pbb. ???? */ @@ -22,15 +24,7 @@ #include "sim-base.h" #include "cgen-sim.h" -/* The _sim_cpu struct. */ - -struct _sim_cpu { - /* sim/common cpu base. */ - sim_cpu_base base; - - /* Static parts of cgen. */ - CGEN_CPU cgen_cpu; - +struct iq2000_sim_cpu { /* CPU specific parts go here. Note that in files that don't need to access these pieces WANT_CPU_FOO won't be defined and thus these parts won't appear. This is ok in the @@ -42,6 +36,7 @@ struct _sim_cpu { IQ2000BF_CPU_DATA cpu_data; #endif }; +#define IQ2000_SIM_CPU(cpu) ((struct iq2000_sim_cpu *) CPU_ARCH_DATA (cpu)) /* Misc. */ -- 2.37.3