QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 1/9] target/alpha: Use cpu_env in preference to ALPHA_CPU
Date: Fri,  3 May 2024 09:20:05 +0200	[thread overview]
Message-ID: <20240503072014.24751-2-philmd@linaro.org> (raw)
In-Reply-To: <20240503072014.24751-1-philmd@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

ALPHA_CPU has a dynamic object type assert, which is
unnecessary considering that these are all class hooks.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/alpha/cpu.c    | 15 ++++++---------
 target/alpha/helper.c |  8 ++++----
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 05f9ee41e9..f98d022671 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -28,25 +28,22 @@
 
 static void alpha_cpu_set_pc(CPUState *cs, vaddr value)
 {
-    AlphaCPU *cpu = ALPHA_CPU(cs);
-
-    cpu->env.pc = value;
+    CPUAlphaState *env = cpu_env(cs);
+    env->pc = value;
 }
 
 static vaddr alpha_cpu_get_pc(CPUState *cs)
 {
-    AlphaCPU *cpu = ALPHA_CPU(cs);
-
-    return cpu->env.pc;
+    CPUAlphaState *env = cpu_env(cs);
+    return env->pc;
 }
 
 static void alpha_restore_state_to_opc(CPUState *cs,
                                        const TranslationBlock *tb,
                                        const uint64_t *data)
 {
-    AlphaCPU *cpu = ALPHA_CPU(cs);
-
-    cpu->env.pc = data[0];
+    CPUAlphaState *env = cpu_env(cs);
+    env->pc = data[0];
 }
 
 static bool alpha_cpu_has_work(CPUState *cs)
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index d6d4353edd..c5e4958f8b 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -124,7 +124,7 @@ void alpha_cpu_record_sigsegv(CPUState *cs, vaddr address,
                               MMUAccessType access_type,
                               bool maperr, uintptr_t retaddr)
 {
-    AlphaCPU *cpu = ALPHA_CPU(cs);
+    CPUAlphaState *env = cpu_env(cs);
     target_ulong mmcsr, cause;
 
     /* Assuming !maperr, infer the missing protection. */
@@ -155,9 +155,9 @@ void alpha_cpu_record_sigsegv(CPUState *cs, vaddr address,
     }
 
     /* Record the arguments that PALcode would give to the kernel. */
-    cpu->env.trap_arg0 = address;
-    cpu->env.trap_arg1 = mmcsr;
-    cpu->env.trap_arg2 = cause;
+    env->trap_arg0 = address;
+    env->trap_arg1 = mmcsr;
+    env->trap_arg2 = cause;
 }
 #else
 /* Returns the OSF/1 entMM failure indication, or -1 on success.  */
-- 
2.41.0



  reply	other threads:[~2024-05-03  7:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  7:20 [PATCH v2 0/9] target/alpha: Implement CF_PCREL Philippe Mathieu-Daudé
2024-05-03  7:20 ` Philippe Mathieu-Daudé [this message]
2024-05-03  7:20 ` [PATCH v2 2/9] target/alpha: Hoist branch shift to initial decode Philippe Mathieu-Daudé
2024-05-03  7:20 ` [PATCH v2 3/9] target/alpha: Use DISAS_NEXT definition instead of magic '0' value Philippe Mathieu-Daudé
2024-05-03  7:20 ` [PATCH v2 4/9] target/alpha: Inline DISAS_PC_UPDATED and return DISAS_NORETURN Philippe Mathieu-Daudé
2024-05-03  7:20 ` [PATCH v2 5/9] target/alpha: Return DISAS_NORETURN once Philippe Mathieu-Daudé
2024-05-03  7:20 ` [PATCH v2 6/9] target/alpha: Simplify gen_bcond_internal() Philippe Mathieu-Daudé
2024-05-04 14:40   ` Richard Henderson
2024-05-03  7:20 ` [PATCH v2 7/9] target/alpha: Split out gen_goto_tb Philippe Mathieu-Daudé
2024-05-03  7:21   ` Philippe Mathieu-Daudé
2024-05-03  7:20 ` [PATCH v2 8/9] target/alpha: Split out gen_pc_disp Philippe Mathieu-Daudé
2024-05-03  7:20 ` [PATCH v2 9/9] target/alpha: Implement CF_PCREL Philippe Mathieu-Daudé
2024-05-03  7:25   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240503072014.24751-2-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).