From nobody Mon Feb 9 02:12:27 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1560698126; cv=none; d=zoho.com; s=zohoarc; b=W0nOTQI7zE/nd/gfOgD8YGM+xZq4nz12FbctbOddn1llkKU5yWAPPJapIuZcQjvErzH9sgJ+kZVGHG+UGYLjg4wB5apUGSrehzP2NOWMrU4SvFR4kt8938vOCeHAjHo0wdu4KtOnyq9scj5t+3/jhzJ9um6/4FxzS8Pxss3BufQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560698126; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=DYPtRe+hiOl4QSSvYFDJeb73zC2Y1wJuBHlE24XYeDQ=; b=nCLcNWkgQiRUmh+j2LgWTqsVpjwxTVKUq4K4mbF5rhSw44xSzjA1EEMAIQtxJAJzySw8tOjZRXOLAjDFiTn5yUSAUDLFTQqQy3mDujg1EOJWuhHsPneBjUhnvVQwCrxXoqJJpfLM/BXvkPIRocWJOIWDmpJysnf04DHsyDSzHs0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560698126188507.98528002200044; Sun, 16 Jun 2019 08:15:26 -0700 (PDT) Received: from localhost ([::1]:40646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcWsE-0004aN-6O for importer@patchew.org; Sun, 16 Jun 2019 11:15:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36573) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcW9i-0005QA-JQ for qemu-devel@nongnu.org; Sun, 16 Jun 2019 10:29:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcW9g-0002YZ-KC for qemu-devel@nongnu.org; Sun, 16 Jun 2019 10:29:14 -0400 Received: from mail02.asahi-net.or.jp ([202.224.55.14]:55645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hcW9c-00025h-Lm for qemu-devel@nongnu.org; Sun, 16 Jun 2019 10:29:08 -0400 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.ablenetvps.ne.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail02.asahi-net.or.jp (Postfix) with ESMTPA id C68B23F4D1; Sun, 16 Jun 2019 23:28:46 +0900 (JST) Received: from yo-satoh-debian.localdomain (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 4F711240085; Sun, 16 Jun 2019 23:28:46 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Date: Sun, 16 Jun 2019 23:28:16 +0900 Message-Id: <20190616142836.10614-5-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190616142836.10614-1-ysato@users.sourceforge.jp> References: <20190616142836.10614-1-ysato@users.sourceforge.jp> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.14 Subject: [Qemu-devel] [PATCH v20 04/24] target/rx: Follow the change of tcg. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, richard.henderson@linaro.org, Yoshinori Sato , philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add cpu-param.h Remove CPU_COMMON Use env_cpu Signed-off-by: Yoshinori Sato --- target/rx/cpu-param.h | 31 +++++++++++++++++++++++++++++++ target/rx/cpu.h | 21 +-------------------- target/rx/cpu.c | 1 + target/rx/op_helper.c | 6 +++--- 4 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 target/rx/cpu-param.h diff --git a/target/rx/cpu-param.h b/target/rx/cpu-param.h new file mode 100644 index 0000000000..5da87fbebe --- /dev/null +++ b/target/rx/cpu-param.h @@ -0,0 +1,31 @@ +/* + * RX cpu parameters + * + * Copyright (c) 2019 Yoshinori Sato + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License f= or + * more details. + * + * You should have received a copy of the GNU General Public License along= with + * this program. If not, see . + */ + +#ifndef RX_CPU_PARAM_H +#define RX_CPU_PARAM_H + +#define TARGET_LONG_BITS 32 +#define TARGET_PAGE_BITS 12 + +#define TARGET_PHYS_ADDR_SPACE_BITS 32 +#define TARGET_VIRT_ADDR_SPACE_BITS 32 + +#define NB_MMU_MODES 1 +#define MMU_MODE0_SUFFIX _all + +#endif diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 3e5f371f51..3f9c4fdd25 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -25,14 +25,8 @@ #include "cpu-qom.h" #include "qom/cpu.h" =20 -#define TARGET_LONG_BITS 32 -#define TARGET_PAGE_BITS 12 - #include "exec/cpu-defs.h" =20 -#define TARGET_PHYS_ADDR_SPACE_BITS 32 -#define TARGET_VIRT_ADDR_SPACE_BITS 32 - /* PSW define */ REG32(PSW, 0) FIELD(PSW, C, 0, 1) @@ -69,9 +63,6 @@ FIELD(FPSW, FX, 30, 1) FIELD(FPSW, FLAGS, 26, 4) FIELD(FPSW, FS, 31, 1) =20 -#define NB_MMU_MODES 1 -#define MMU_MODE0_SUFFIX _all - enum { NUM_REGS =3D 16, }; @@ -108,8 +99,6 @@ typedef struct CPURXState { uint32_t ack_ipl; /* execute ipl */ float_status fp_status; qemu_irq ack; /* Interrupt acknowledge */ - - CPU_COMMON } CPURXState; =20 /* @@ -123,19 +112,13 @@ struct RXCPU { CPUState parent_obj; /*< public >*/ =20 + CPUNegativeOffsetState neg; CPURXState env; }; =20 typedef struct RXCPU RXCPU; typedef RXCPU ArchCPU; =20 -static inline RXCPU *rx_env_get_cpu(CPURXState *env) -{ - return container_of(env, RXCPU, env); -} - -#define ENV_GET_CPU(e) CPU(rx_env_get_cpu(e)) - #define ENV_OFFSET offsetof(RXCPU, env) =20 #define RX_CPU_TYPE_SUFFIX "-" TYPE_RX_CPU @@ -156,8 +139,6 @@ int cpu_rx_signal_handler(int host_signum, void *pinfo, void *puc); =20 void rx_cpu_list(void); -void rx_load_image(RXCPU *cpu, const char *filename, - uint32_t start, uint32_t size); void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte); =20 #define cpu_signal_handler cpu_rx_signal_handler diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 4147c5c939..a6dde613ab 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -173,6 +173,7 @@ static void rx_cpu_init(Object *obj) RXCPU *cpu =3D RXCPU(obj); CPURXState *env =3D &cpu->env; =20 + cpu_set_cpustate_pointers(cpu); cs->env_ptr =3D env; qdev_init_gpio_in(DEVICE(cpu), rx_cpu_set_irq, 2); } diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c index fb7ae3c3ec..f89d294f2b 100644 --- a/target/rx/op_helper.c +++ b/target/rx/op_helper.c @@ -421,7 +421,7 @@ uint32_t helper_divu(CPURXState *env, uint32_t num, uin= t32_t den) static inline void QEMU_NORETURN raise_exception(CPURXState *env, int inde= x, uintptr_t retaddr) { - CPUState *cs =3D CPU(rx_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D index; cpu_loop_exit_restore(cs, retaddr); @@ -444,7 +444,7 @@ void QEMU_NORETURN helper_raise_illegal_instruction(CPU= RXState *env) =20 void QEMU_NORETURN helper_wait(CPURXState *env) { - CPUState *cs =3D CPU(rx_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); =20 cs->halted =3D 1; env->in_sleep =3D 1; @@ -453,7 +453,7 @@ void QEMU_NORETURN helper_wait(CPURXState *env) =20 void QEMU_NORETURN helper_debug(CPURXState *env) { - CPUState *cs =3D CPU(rx_env_get_cpu(env)); + CPUState *cs =3D env_cpu(env); =20 cs->exception_index =3D EXCP_DEBUG; cpu_loop_exit(cs); --=20 2.11.0