[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_to()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 13/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_to() |
Date: |
Mon, 13 Jan 2025 01:47:38 +0100 |
Propagate the target agnostic CPU pointer to the publicly
declared bl_gen_jump_to() function.
Include "target/mips/cpu-qom.h" to get MIPSCPU typedef.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/mips/bootloader.h | 3 ++-
hw/mips/bootloader.c | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h
index c32f6c28356..daa2b92e249 100644
--- a/include/hw/mips/bootloader.h
+++ b/include/hw/mips/bootloader.h
@@ -10,8 +10,9 @@
#define HW_MIPS_BOOTLOADER_H
#include "exec/cpu-defs.h"
+#include "target/mips/cpu-qom.h"
-void bl_gen_jump_to(void **ptr, target_ulong jump_addr);
+void bl_gen_jump_to(const MIPSCPU *cpu, void **ptr, target_ulong jump_addr);
void bl_gen_jump_kernel(void **ptr,
bool set_sp, target_ulong sp,
bool set_a0, target_ulong a0,
diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index e29eb5e92f3..6f055228392 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -249,11 +249,11 @@ static void bl_gen_load_ulong(const CPUMIPSState *env,
void **p,
}
/* Helpers */
-void bl_gen_jump_to(void **p, target_ulong jump_addr)
+void bl_gen_jump_to(const MIPSCPU *cpu, void **p, target_ulong jump_addr)
{
- bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_T9, jump_addr);
- bl_gen_jalr(&MIPS_CPU(first_cpu)->env, p, BL_REG_T9);
- bl_gen_nop(&MIPS_CPU(first_cpu)->env, p); /* delay slot */
+ bl_gen_load_ulong(&cpu->env, p, BL_REG_T9, jump_addr);
+ bl_gen_jalr(&cpu->env, p, BL_REG_T9);
+ bl_gen_nop(&cpu->env, p); /* delay slot */
}
void bl_gen_jump_kernel(void **p,
@@ -280,7 +280,7 @@ void bl_gen_jump_kernel(void **p,
bl_gen_load_ulong(&MIPS_CPU(first_cpu)->env, p, BL_REG_A3, a3);
}
- bl_gen_jump_to(p, kernel_addr);
+ bl_gen_jump_to(MIPS_CPU(first_cpu), p, kernel_addr);
}
void bl_gen_write_ulong(void **p, target_ulong addr, target_ulong val)
--
2.47.1
- [PATCH 02/23] hw/mips/malta: Check CPU index instead of using &first_cpu, (continued)
- [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é, 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é <=
- [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
- [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