[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/19] hw/mips/bootloader: Propagate CPU env to bl_gen_s[w, d]
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 14/19] hw/mips/bootloader: Propagate CPU env to bl_gen_s[w, d]() |
Date: |
Mon, 13 Jan 2025 20:55:20 +0100 |
Propagate the target specific CPU env to the locally
declared bl_gen_sw() and bl_gen_sd() functions.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/bootloader.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 464ed5f4f1a..288dccce473 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -194,7 +194,8 @@ static void bl_gen_sw_nm(void **ptr, bl_reg rt, uint8_t rs,
uint16_t ofs12)
st_nm32_p(ptr, insn);
}
-static void bl_gen_sw(void **p, bl_reg rt, uint8_t base, uint16_t offset)
+static void bl_gen_sw(const CPUMIPSState *env, void **p,
+ bl_reg rt, uint8_t base, uint16_t offset)
{
if (bootcpu_supports_isa(ISA_NANOMIPS32)) {
bl_gen_sw_nm(p, rt, base, offset);
@@ -203,7 +204,8 @@ static void bl_gen_sw(void **p, bl_reg rt, uint8_t base,
uint16_t offset)
}
}
-static void bl_gen_sd(void **p, bl_reg rt, uint8_t base, uint16_t offset)
+static void bl_gen_sd(const CPUMIPSState *env, void **p,
+ bl_reg rt, uint8_t base, uint16_t offset)
{
if (bootcpu_supports_isa(ISA_MIPS3)) {
bl_gen_i_type(p, 0x3f, base, rt, offset);
@@ -292,9 +294,9 @@ void bl_gen_write_ulong(const MIPSCPU *cpu, void **p,
bl_gen_load_ulong(env, p, BL_REG_K0, val);
bl_gen_load_ulong(env, p, BL_REG_K1, addr);
if (bootcpu_supports_isa(ISA_MIPS3)) {
- bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0);
+ bl_gen_sd(env, p, BL_REG_K0, BL_REG_K1, 0x0);
} else {
- bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0);
+ bl_gen_sw(env, p, BL_REG_K0, BL_REG_K1, 0x0);
}
}
@@ -305,7 +307,7 @@ void bl_gen_write_u32(const MIPSCPU *cpu, void **p,
bl_gen_li(env, p, BL_REG_K0, val);
bl_gen_load_ulong(env, p, BL_REG_K1, addr);
- bl_gen_sw(p, BL_REG_K0, BL_REG_K1, 0x0);
+ bl_gen_sw(env, p, BL_REG_K0, BL_REG_K1, 0x0);
}
void bl_gen_write_u64(const MIPSCPU *cpu, void **p,
@@ -315,5 +317,5 @@ void bl_gen_write_u64(const MIPSCPU *cpu, void **p,
bl_gen_dli(env, p, BL_REG_K0, val);
bl_gen_load_ulong(env, p, BL_REG_K1, addr);
- bl_gen_sd(p, BL_REG_K0, BL_REG_K1, 0x0);
+ bl_gen_sd(env, p, BL_REG_K0, BL_REG_K1, 0x0);
}
--
2.47.1
- [PATCH v2 03/19] hw/mips/malta: Keep reference of vCPUs in MaltaState, (continued)
- [PATCH v2 03/19] hw/mips/malta: Keep reference of vCPUs in MaltaState, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 04/19] hw/mips/malta: Propagate MaltaState to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 05/19] hw/mips/malta: Propagate MaltaState to bl_setup_gt64120_jump_kernel(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 06/19] hw/mips/boston: Replace bl_gen_write_ulong() -> bl_gen_write_u64(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 07/19] hw/mips/boston: Propagate CPU to gen_firmware(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 08/19] hw/mips/fuloong: Propagate CPU to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 09/19] hw/mips/bootloader: Document public API, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 11/19] hw/mips/bootloader: Propagate CPU to bl_gen_jump_[to, kernel](), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 12/19] hw/mips/bootloader: Propagate CPU env to bl_gen_load_ulong(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 13/19] hw/mips/bootloader: Propagate CPU env to bl_gen_[d]li(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 14/19] hw/mips/bootloader: Propagate CPU env to bl_gen_s[w, d](),
Philippe Mathieu-Daudé <=
- [PATCH v2 16/19] hw/mips/bootloader: Propagate CPU env to bl_gen_dsll(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 10/19] hw/mips/bootloader: Propagate CPU to bl_gen_write_u[32, 64, long](), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 15/19] hw/mips/bootloader: Propagate CPU env to bl_gen_jalr(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 17/19] hw/mips/bootloader: Propagate CPU env to bl_gen_nop(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 19/19] hw/mips/bootloader: Remove use of &first_cpu in bootcpu_supports_isa(), Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 18/19] hw/mips/bootloader: Propagate CPU env to bootcpu_supports_isa(), Philippe Mathieu-Daudé, 2025/01/13
- Re: [PATCH v2 00/19] hw/mips: Remove all uses of &first_cpu, Jiaxun Yang, 2025/01/13