From patchwork Sat Nov 5 13:32:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 60015 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 57B9A38576AA for ; Sat, 5 Nov 2022 13:36:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57B9A38576AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667655408; bh=sSshw4dQs34xLGyNczqMdxDIGWRu/mrPjY2TTx/JBrc=; 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=ihJF0Uc2kMXvSYCq1pPoc5xbG+1j+GY4ru9E9HQsC6JGa36hb4JFec3VoBo97eBtM D6DuilVeKXB/p+gBJ4g64gJAPK5gQxIDqadZfZXHOLAMSY4nAz4Q2kc5mAF1FUfx7W ec3W4B9zhCmq+AL3D26rAEwK3YzkjNv9DD6CQio4= 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 0351C3858029 for ; Sat, 5 Nov 2022 13:33:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0351C3858029 Received: by smtp.gentoo.org (Postfix, from userid 559) id AD4C03412D2; Sat, 5 Nov 2022 13:33:42 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 17/26] sim: cgen: prep for inverting sim_cpu storage Date: Sat, 5 Nov 2022 20:32:49 +0700 Message-Id: <20221105133258.23409-18-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221105133258.23409-1-vapier@gentoo.org> References: <20221101151158.24916-1-vapier@gentoo.org> <20221105133258.23409-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, KAM_SHORT, 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" Some common cgen code changes to allow cgen ports to invert their sim_cpu storage one-by-one. --- sim/common/cgen-cpu.h | 5 +++++ sim/common/sim-cpu.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/sim/common/cgen-cpu.h b/sim/common/cgen-cpu.h index 92161a84b875..d65e0dba0b20 100644 --- a/sim/common/cgen-cpu.h +++ b/sim/common/cgen-cpu.h @@ -20,6 +20,11 @@ along with this program. If not, see . */ #ifndef CGEN_CPU_H #define CGEN_CPU_H +#include "cgen-defs.h" +#include "cgen-fpu.h" +#include "cgen-par.h" +#include "cgen-scache.h" + /* Type of function that is ultimately called by sim_resume. */ typedef void (ENGINE_FN) (SIM_CPU *); diff --git a/sim/common/sim-cpu.h b/sim/common/sim-cpu.h index ab41508acb65..e895664c2efb 100644 --- a/sim/common/sim-cpu.h +++ b/sim/common/sim-cpu.h @@ -28,6 +28,10 @@ along with this program. If not, see . */ /* Type of function to return an insn name. */ typedef const char * (CPU_INSN_NAME_FN) (sim_cpu *, int); +#ifdef CGEN_ARCH +# include "cgen-cpu.h" +#endif + /* Types for register access functions. These routines implement the sim_{fetch,store}_register interface. */ typedef int (CPUREG_FETCH_FN) (sim_cpu *, int, void *, int); @@ -127,6 +131,12 @@ struct _sim_cpu { /* All the common state. */ sim_cpu_base base; +#ifdef CGEN_ARCH + /* Static parts of cgen. */ + CGEN_CPU cgen_cpu; +#define CPU_CGEN_CPU(cpu) ((cpu)->cgen_cpu) +#endif + /* Pointer for sim target to store arbitrary cpu data. Normally the target should define a struct and use it here. */ void *arch_data;