[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_ulong()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 15/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_ulong() |
Date: |
Mon, 13 Jan 2025 01:47:40 +0100 |
Propagate the target agnostic CPU pointer to the publicly
declared bl_gen_write_ulong() function.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/mips/bootloader.h | 3 ++-
hw/mips/bootloader.c | 13 +++++++------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h
index 6b58eafb8bc..a7f174e16bc 100644
--- a/include/hw/mips/bootloader.h
+++ b/include/hw/mips/bootloader.h
@@ -20,7 +20,8 @@ void bl_gen_jump_kernel(const MIPSCPU *cpu, void **ptr,
bool set_a2, target_ulong a2,
bool set_a3, target_ulong a3,
target_ulong kernel_addr);
-void bl_gen_write_ulong(void **ptr, target_ulong addr, target_ulong val);
+void bl_gen_write_ulong(const MIPSCPU *cpu, void **ptr,
+ target_ulong addr, target_ulong val);
void bl_gen_write_u32(void **ptr, target_ulong addr, uint32_t val);
void bl_gen_write_u64(void **ptr, target_ulong addr, uint64_t val);
diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 9804051ab2d..c4fd85b9f42 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -283,14 +283,15 @@ void bl_gen_jump_kernel(const MIPSCPU *cpu, void **p,
bl_gen_jump_to(cpu, p, kernel_addr);
}
-void bl_gen_write_ulong(void **p, target_ulong addr, target_ulong val)
+void bl_gen_write_ulong(const MIPSCPU *cpu, void **p,
+ target_ulong addr, target_ulong val)
{
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, val);
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_K1, addr);
- if (bootcpu_supports_isa(&MIPS_CPU(first_cpu)->env, ISA_MIPS3)) {
- bl_gen_sd(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, BL_REG_K1, 0x0);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_K0, val);
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_K1, addr);
+ if (bootcpu_supports_isa(&cpu->env, ISA_MIPS3)) {
+ bl_gen_sd(&cpu->env, p, BL_REG_K0, BL_REG_K1, 0x0);
} else {
- bl_gen_sw(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, BL_REG_K1, 0x0);
+ bl_gen_sw(&cpu->env, p, BL_REG_K0, BL_REG_K1, 0x0);
}
}
--
2.47.1
- [PATCH 05/23] hw/mips/bootloader: Propagate CPU env to bl_gen_nop(), (continued)
- [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é, 2025/01/12
- [PATCH 15/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_ulong(),
Philippe Mathieu-Daudé <=
- [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