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 B9D98385841E for ; Tue, 1 Nov 2022 16:27:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B9D98385841E 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 6B4F6340EF3; Tue, 1 Nov 2022 16:27:03 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 19/27] sim: bpf: invert sim_cpu storage Date: Tue, 1 Nov 2022 20:56:50 +0545 Message-Id: <20221101151158.24916-20-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=-1.0 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,UNWANTED_LANGUAGE_BODY 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/bpf/cpu.h | 2 +- sim/bpf/sim-main.h | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sim/bpf/cpu.h b/sim/bpf/cpu.h index 5dd42de6a756..fb5344e0b767 100644 --- a/sim/bpf/cpu.h +++ b/sim/bpf/cpu.h @@ -54,7 +54,7 @@ do { \ CPU (h_pc) = (x);\ ;} while (0) } hardware; -#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware) +#define CPU_CGEN_HW(cpu) (& BPF_SIM_CPU (cpu)->cpu_data.hardware) } BPFBF_CPU_DATA; /* Cover fns for register access. */ diff --git a/sim/bpf/sim-main.h b/sim/bpf/sim-main.h index 80538840886e..bb6037737f98 100644 --- a/sim/bpf/sim-main.h +++ b/sim/bpf/sim-main.h @@ -19,6 +19,8 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define SIM_HAVE_COMMON_SIM_CPU + #include "sim-basics.h" #include "cgen-types.h" #include "bpf-desc.h" @@ -29,15 +31,12 @@ #include "bpf-sim.h" #include "bpf-helpers.h" - -struct _sim_cpu +struct bpf_sim_cpu { - sim_cpu_base base; - CGEN_CPU cgen_cpu; - #if defined (WANT_CPU_BPFBF) BPFBF_CPU_DATA cpu_data; #endif }; +#define BPF_SIM_CPU(cpu) ((struct bpf_sim_cpu *) CPU_ARCH_DATA (cpu)) #endif /* ! SIM_MAIN_H */ -- 2.37.3