[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/19] hw/mips/bootloader: Document public API
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 09/19] hw/mips/bootloader: Document public API |
Date: |
Mon, 13 Jan 2025 20:55:15 +0100 |
Document bl_gen_write_u[32,64,long]() and bl_gen_jump_[to,kernel]()
prototypes.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/mips/bootloader.h | 50 ++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h
index c32f6c28356..8533a16ca62 100644
--- a/include/hw/mips/bootloader.h
+++ b/include/hw/mips/bootloader.h
@@ -11,7 +11,30 @@
#include "exec/cpu-defs.h"
+/**
+ * bl_gen_jump_to: Generate bootloader code to jump to an address
+ *
+ * @ptr: Pointer to buffer where to write the bootloader code
+ * @jump_addr: Address to jump to
+ */
void bl_gen_jump_to(void **ptr, target_ulong jump_addr);
+
+/**
+ * bl_gen_jump_kernel: Generate bootloader code to jump to a Linux kernel
+ *
+ * @ptr: Pointer to buffer where to write the bootloader code
+ * @set_sp: Whether to set $sp register
+ * @set_a0: Whether to set $a0 register
+ * @set_a1: Whether to set $a1 register
+ * @set_a2: Whether to set $a2 register
+ * @set_a3: Whether to set $a3 register
+ * @sp: Value to set $sp to if @set_sp is set
+ * @a0: Value to set $a0 to if @set_a0 is set
+ * @a1: Value to set $a0 to if @set_a1 is set
+ * @a2: Value to set $a0 to if @set_a2 is set
+ * @a3: Value to set $a0 to if @set_a3 is set
+ * @kernel_addr: Start address of the kernel to jump to
+ */
void bl_gen_jump_kernel(void **ptr,
bool set_sp, target_ulong sp,
bool set_a0, target_ulong a0,
@@ -19,8 +42,35 @@ void bl_gen_jump_kernel(void **ptr,
bool set_a2, target_ulong a2,
bool set_a3, target_ulong a3,
target_ulong kernel_addr);
+
+/**
+ * bl_gen_write_ulong: Generate bootloader code to write an unsigned long
+ * value at an address
+ *
+ * @ptr: Pointer to buffer where to write the bootloader code
+ * @addr: Address to write to
+ * @val: Value to write at @addr
+ */
void bl_gen_write_ulong(void **ptr, target_ulong addr, target_ulong val);
+
+/**
+ * bl_gen_write_u32: Generate bootloader code to write a 32-bit unsigned
+ * value at an address
+ *
+ * @ptr: Pointer to buffer where to write the bootloader code
+ * @addr: Address to write to
+ * @val: Value to write at @addr
+ */
void bl_gen_write_u32(void **ptr, target_ulong addr, uint32_t val);
+
+/**
+ * bl_gen_write_u64: Generate bootloader code to write a 64-bit unsigned
+ * value at an address
+ *
+ * @ptr: Pointer to buffer where to write the bootloader code
+ * @addr: Address to write to
+ * @val: Value to write at @addr
+ */
void bl_gen_write_u64(void **ptr, target_ulong addr, uint64_t val);
#endif
--
2.47.1
- [PATCH v2 00/19] hw/mips: Remove all uses of &first_cpu, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 01/19] hw/mips/cps: Keep reference of vCPUs in MIPSCPSState, Philippe Mathieu-Daudé, 2025/01/13
- [PATCH v2 02/19] hw/mips/malta: Check CPU index instead of using &first_cpu, Philippe Mathieu-Daudé, 2025/01/13
- [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é <=
- [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é, 2025/01/13
- [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