[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_kernel()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 14/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_kernel() |
Date: |
Mon, 13 Jan 2025 01:47:39 +0100 |
Propagate the target agnostic CPU pointer to the publicly
declared bl_gen_jump_kernel() function.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/mips/bootloader.h | 2 +-
hw/mips/bootloader.c | 14 +++++++-------
hw/mips/boston.c | 2 +-
hw/mips/fuloong2e.c | 2 +-
hw/mips/malta.c | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h
index daa2b92e249..6b58eafb8bc 100644
--- a/include/hw/mips/bootloader.h
+++ b/include/hw/mips/bootloader.h
@@ -13,7 +13,7 @@
#include "target/mips/cpu-qom.h"
void bl_gen_jump_to(const MIPSCPU *cpu, void **ptr, target_ulong jump_addr);
-void bl_gen_jump_kernel(void **ptr,
+void bl_gen_jump_kernel(const MIPSCPU *cpu, void **ptr,
bool set_sp, target_ulong sp,
bool set_a0, target_ulong a0,
bool set_a1, target_ulong a1,
diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 6f055228392..9804051ab2d 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -256,7 +256,7 @@ void bl_gen_jump_to(const MIPSCPU *cpu, void **p,
target_ulong jump_addr)
bl_gen_nop(&cpu->env, p); /* delay slot */
}
-void bl_gen_jump_kernel(void **p,
+void bl_gen_jump_kernel(const MIPSCPU *cpu, void **p,
bool set_sp, target_ulong sp,
bool set_a0, target_ulong a0,
bool set_a1, target_ulong a1,
@@ -265,22 +265,22 @@ void bl_gen_jump_kernel(void **p,
target_ulong kernel_addr)
{
if (set_sp) {
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_SP, sp);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_SP, sp);
}
if (set_a0) {
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_A0, a0);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_A0, a0);
}
if (set_a1) {
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_A1, a1);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_A1, a1);
}
if (set_a2) {
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_A2, a2);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_A2, a2);
}
if (set_a3) {
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_A3, a3);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_A3, a3);
}
- bl_gen_jump_to(MIPS_CPU(first_cpu), p, kernel_addr);
+ bl_gen_jump_to(cpu, p, kernel_addr);
}
void bl_gen_write_ulong(void **p, target_ulong addr, target_ulong val)
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 63dc654192a..3a06b776fe8 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -352,7 +352,7 @@ static void gen_firmware(void *p, hwaddr kernel_entry,
hwaddr fdt_addr)
* a2/$6 = 0
* a3/$7 = 0
*/
- bl_gen_jump_kernel(&p,
+ bl_gen_jump_kernel(MIPS_CPU(first_cpu), &p,
true, 0, true, (int32_t)-2,
true, fdt_addr, true, 0, true, 0,
kernel_entry);
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 16b6a5129e7..b87622ee6e3 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -179,7 +179,7 @@ static void write_bootloader(CPUMIPSState *env, uint8_t
*base,
/* Second part of the bootloader */
p = (uint32_t *)(base + 0x040);
- bl_gen_jump_kernel((void **)&p,
+ bl_gen_jump_kernel(MIPS_CPU(first_cpu), (void **)&p,
true, ENVP_VADDR - 64,
true, 2, true, ENVP_VADDR,
true, ENVP_VADDR + 8,
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 37be2330eda..fe9e06f48f4 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -678,7 +678,7 @@ static void bl_setup_gt64120_jump_kernel(void **p, uint64_t
run_addr,
cpu_mips_phys_to_kseg1(NULL, 0x1be00000 + 0xcfc),
tswap32(ldl_be_p(pci_pins_cfg)));
- bl_gen_jump_kernel(p,
+ bl_gen_jump_kernel(MIPS_CPU(first_cpu), p,
true, ENVP_VADDR - 64,
/*
* If semihosting is used, arguments have already
--
2.47.1
- [PATCH 04/23] hw/mips/bootloader: Propagate CPU env to bootcpu_supports_isa(), (continued)
- [PATCH 04/23] hw/mips/bootloader: Propagate CPU env to bootcpu_supports_isa(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 05/23] hw/mips/bootloader: Propagate CPU env to bl_gen_nop(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 06/23] hw/mips/bootloader: Propagate CPU env to bl_gen_dsll(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 08/23] hw/mips/bootloader: Propagate CPU env to bl_gen_sw(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 09/23] hw/mips/bootloader: Propagate CPU env to bl_gen_sd(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 07/23] hw/mips/bootloader: Propagate CPU env to bl_gen_jalr(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 10/23] hw/mips/bootloader: Propagate CPU env to bl_gen_li(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 11/23] hw/mips/bootloader: Propagate CPU env to bl_gen_dli(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 12/23] hw/mips/bootloader: Propagate CPU env to bl_gen_load_ulong(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 13/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_to(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 14/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_kernel(),
Philippe Mathieu-Daudé <=
- [PATCH 15/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_ulong(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 16/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_u32(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 18/23] hw/mips/boston: Propagate CPU to gen_firmware(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 17/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_u64(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 19/23] hw/mips/fuloong: Propagate CPU to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 20/23] hw/mips/malta: Keep reference of vCPUs in MaltaState, Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 21/23] hw/mips/malta: Propagate MaltaState to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 22/23] hw/mips/malta: Propagate MaltaState to bl_setup_gt64120_jump_kernel(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 23/23] hw/mips/malta: Remove all uses of &first_cpu global, Philippe Mathieu-Daudé, 2025/01/12
- Re: [PATCH 00/23] hw/mips: Remove all uses of &first_cpu, Philippe Mathieu-Daudé, 2025/01/13