From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
"Aleksandar Rikalo" <arikalo@gmail.com>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Bernhard Beschow" <shentey@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Huacai Chen" <chenhuacai@kernel.org>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH 4/6] target/mips: Pass env to cpu_mips_clock_init()
Date: Tue, 21 Jan 2025 17:18:15 +0100 [thread overview]
Message-ID: <20250121161817.33654-5-philmd@linaro.org> (raw)
In-Reply-To: <20250121161817.33654-1-philmd@linaro.org>
Simplify cpu_mips_clock_init() by having it directly take
a CPU env, move its declaration from "cpu.h" to "internal.h",
as it shouldn't be accessible from hw/.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/mips/cpu.h | 1 -
target/mips/internal.h | 1 +
target/mips/cpu.c | 2 +-
target/mips/system/cp0_timer.c | 4 +---
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index f6877ece8b4..e5767ea9cf3 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -1361,7 +1361,6 @@ uint64_t cpu_mips_phys_to_kseg1(void *opaque, uint64_t addr);
/* HW declaration specific to the MIPS target */
void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);
void cpu_mips_irq_init_cpu(MIPSCPU *cpu);
-void cpu_mips_clock_init(MIPSCPU *cpu);
#endif /* !CONFIG_USER_ONLY */
diff --git a/target/mips/internal.h b/target/mips/internal.h
index 28eb28936ba..69452aae5bc 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -214,6 +214,7 @@ void cpu_mips_store_count(CPUMIPSState *env, uint32_t value);
void cpu_mips_store_compare(CPUMIPSState *env, uint32_t value);
void cpu_mips_start_count(CPUMIPSState *env);
void cpu_mips_stop_count(CPUMIPSState *env);
+void cpu_mips_clock_init(CPUMIPSState *env);
static inline void mips_env_set_pc(CPUMIPSState *env, target_ulong value)
{
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 95df8985bc6..99f442a4b98 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -479,7 +479,7 @@ static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
/* Init internal devices */
#ifndef CONFIG_USER_ONLY
cpu_mips_irq_init_cpu(cpu);
- cpu_mips_clock_init(cpu);
+ cpu_mips_clock_init(env);
#endif
if (!clock_get(cpu->clock)) {
#ifndef CONFIG_USER_ONLY
diff --git a/target/mips/system/cp0_timer.c b/target/mips/system/cp0_timer.c
index ca16945cee1..07641cab521 100644
--- a/target/mips/system/cp0_timer.c
+++ b/target/mips/system/cp0_timer.c
@@ -133,10 +133,8 @@ static void mips_timer_cb(void *opaque)
cpu_mips_timer_expire(env);
}
-void cpu_mips_clock_init(MIPSCPU *cpu)
+void cpu_mips_clock_init(CPUMIPSState *env)
{
- CPUMIPSState *env = &cpu->env;
-
/*
* If we're in KVM mode, don't create the periodic timer, that is handled in
* kernel.
--
2.47.1
next prev parent reply other threads:[~2025-01-21 16:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 16:18 [PATCH 0/6] target/mips: Convert legacy qemu_allocate_irqs() to qemu_init_irq() Philippe Mathieu-Daudé
2025-01-21 16:18 ` [PATCH 1/6] hw/pci-host/bonito: Expose output IRQ as QDev GPIO Philippe Mathieu-Daudé
2025-01-21 16:18 ` [PATCH 2/6] target/mips: Create clock *after* accelerator vCPU is realized Philippe Mathieu-Daudé
2025-01-21 16:18 ` [PATCH 3/6] target/mips: Initialize CPU-specific timer/IRQs once in DeviceRealize Philippe Mathieu-Daudé
2025-01-21 23:07 ` Richard Henderson
2025-01-21 16:18 ` Philippe Mathieu-Daudé [this message]
2025-01-21 16:18 ` [PATCH 5/6] target/mips: Move CPU timer from hw/mips/ to target/mips/system/ Philippe Mathieu-Daudé
2025-01-21 23:08 ` Richard Henderson
2025-01-21 16:18 ` [PATCH 6/6] target/mips: Allocate CPU IRQs within CPUMIPSState Philippe Mathieu-Daudé
2025-01-21 16:20 ` Philippe Mathieu-Daudé
2025-01-21 23:12 ` Richard Henderson
2025-01-21 16:42 ` [PATCH 0/6] target/mips: Convert legacy qemu_allocate_irqs() to qemu_init_irq() 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=20250121161817.33654-5-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=arikalo@gmail.com \
--cc=aurelien@aurel32.net \
--cc=chenhuacai@kernel.org \
--cc=hpoussin@reactos.org \
--cc=jiaxun.yang@flygoat.com \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.