From patchwork Tue Nov 1 15:11:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59748 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 D7FBC381E71D for ; Tue, 1 Nov 2022 16:30:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7FBC381E71D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667320223; bh=7uXDg82Nx97H1z9iI4Jm5gXx2a/Nu/+QiaTaE3JKACk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qnRAzHMZ4ToXRtBZ341w+9YCO0PWM+jfFfaBPTpUXgjMqd2Wbw6xYm4cNYBLMZTfQ b/+3IDXJ09bH/SEyKx9eWYrkS8DnopVnNSmbbXgajN8EuIICsgCxJOaC9y1YOc4owT 2LU2WtkgExwiuWQLDXlfgKUc4wbaviaMrorN7Gvo= 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 5FB92385C335 for ; Tue, 1 Nov 2022 16:27:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5FB92385C335 Received: by smtp.gentoo.org (Postfix, from userid 559) id 0D077340DA4; Tue, 1 Nov 2022 16:27:12 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 23/27] sim: lm32: invert sim_cpu storage Date: Tue, 1 Nov 2022 20:56:54 +0545 Message-Id: <20221101151158.24916-24-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 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 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-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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/lm32/cpu.h | 2 +- sim/lm32/sim-main.h | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sim/lm32/cpu.h b/sim/lm32/cpu.h index d025065f2ba9..f179cfce30e9 100644 --- a/sim/lm32/cpu.h +++ b/sim/lm32/cpu.h @@ -54,7 +54,7 @@ typedef struct { #define GET_H_CSR(a1) CPU (h_csr)[a1] #define SET_H_CSR(a1, x) (CPU (h_csr)[a1] = (x)) } hardware; -#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware) +#define CPU_CGEN_HW(cpu) (& LM32_SIM_CPU (cpu)->cpu_data.hardware) } LM32BF_CPU_DATA; /* Cover fns for register access. */ diff --git a/sim/lm32/sim-main.h b/sim/lm32/sim-main.h index 14da34c55199..17c817cb1f69 100644 --- a/sim/lm32/sim-main.h +++ b/sim/lm32/sim-main.h @@ -23,6 +23,8 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define SIM_HAVE_COMMON_SIM_CPU + #define WITH_SCACHE_PBB 1 #include "symcat.h" @@ -36,16 +38,8 @@ #include "lm32-sim.h" #include "opcode/cgen.h" -/* The _sim_cpu struct. */ - -struct _sim_cpu +struct lm32_sim_cpu { - /* sim/common cpu base. */ - sim_cpu_base base; - - /* Static parts of cgen. */ - CGEN_CPU cgen_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 @@ -56,8 +50,8 @@ struct _sim_cpu #if defined (WANT_CPU_LM32BF) LM32BF_CPU_DATA cpu_data; #endif - }; +#define LM32_SIM_CPU(cpu) ((struct lm32_sim_cpu *) CPU_ARCH_DATA (cpu)) /* Misc. */