[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/23] hw/mips/bootloader: Propagate CPU env to bl_gen_dli()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 11/23] hw/mips/bootloader: Propagate CPU env to bl_gen_dli() |
Date: |
Mon, 13 Jan 2025 01:47:36 +0100 |
Propagate the target specific CPU env to the locally
declared bl_gen_dli() function.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/bootloader.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 32811e48cdd..95ee59f33c9 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -228,19 +228,20 @@ static void bl_gen_li(const CPUMIPSState *env, void **p,
}
}
-static void bl_gen_dli(void **p, bl_reg rt, uint64_t imm)
+static void bl_gen_dli(const CPUMIPSState *env, void **p,
+ bl_reg rt, uint64_t imm)
{
- bl_gen_li(&MIPS_CPU(first_cpu)->env, p, rt, extract64(imm, 32, 32));
- bl_gen_dsll(&MIPS_CPU(first_cpu)->env, p, rt, rt, 16);
+ bl_gen_li(env, p, rt, extract64(imm, 32, 32));
+ bl_gen_dsll(env, p, rt, rt, 16);
bl_gen_ori(p, rt, rt, extract64(imm, 16, 16));
- bl_gen_dsll(&MIPS_CPU(first_cpu)->env, p, rt, rt, 16);
+ bl_gen_dsll(env, p, rt, rt, 16);
bl_gen_ori(p, rt, rt, extract64(imm, 0, 16));
}
static void bl_gen_load_ulong(void **p, bl_reg rt, target_ulong imm)
{
if (bootcpu_supports_isa(&MIPS_CPU(first_cpu)->env, ISA_MIPS3)) {
- bl_gen_dli(p, rt, imm); /* 64bit */
+ bl_gen_dli(&MIPS_CPU(first_cpu)->env, p, rt, imm); /* 64bit */
} else {
bl_gen_li(&MIPS_CPU(first_cpu)->env, p, rt, imm); /* 32bit */
}
@@ -301,7 +302,7 @@ void bl_gen_write_u32(void **p, target_ulong addr, uint32_t
val)
void bl_gen_write_u64(void **p, target_ulong addr, uint64_t val)
{
- bl_gen_dli(p, BL_REG_K0, val);
+ bl_gen_dli(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, val);
bl_gen_load_ulong(p, BL_REG_K1, addr);
bl_gen_sd(&MIPS_CPU(first_cpu)->env, p, BL_REG_K0, BL_REG_K1, 0x0);
}
--
2.47.1
- [PATCH 01/23] hw/mips/cps: Keep reference of vCPUs in MIPSCPSState, (continued)
- [PATCH 01/23] hw/mips/cps: Keep reference of vCPUs in MIPSCPSState, Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 03/23] hw/mips/boston: Replace bl_gen_write_ulong() -> bl_gen_write_u64(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 02/23] hw/mips/malta: Check CPU index instead of using &first_cpu, Philippe Mathieu-Daudé, 2025/01/12
- [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é <=
- [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é, 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