summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJiaxun Yang2021-01-27 07:54:21 +0100
committerPhilippe Mathieu-Daudé2021-02-21 18:41:04 +0100
commit3ebbf86128f5607831ba5a3dec8bac02271a9390 (patch)
tree4e46901992d9b65a8834116065d54e462fb58d06 /include
parenthw/mips: loongson3: Drop 'struct MemmapEntry' (diff)
downloadqemu-3ebbf86128f5607831ba5a3dec8bac02271a9390.tar.gz
qemu-3ebbf86128f5607831ba5a3dec8bac02271a9390.tar.xz
qemu-3ebbf86128f5607831ba5a3dec8bac02271a9390.zip
hw/mips: Add a bootloader helper
Add a bootloader helper to generate simple bootloaders for kernel. It can help us reduce inline hex hack and also keep MIPS release 6 compatibility easier. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210127065424.114125-2-jiaxun.yang@flygoat.com> [PMD: Restricted bl_reg enum to C source, inverted bl_gen_write() args, added license in hw/mips/bootloader.h] Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/mips/bootloader.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h
new file mode 100644
index 0000000000..b5f48d71bb
--- /dev/null
+++ b/include/hw/mips/bootloader.h
@@ -0,0 +1,22 @@
+/*
+ * Utility for QEMU MIPS to generate it's simple bootloader
+ *
+ * Copyright (C) 2020 Jiaxun Yang <jiaxun.yang@flygoat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_MIPS_BOOTLOADER_H
+#define HW_MIPS_BOOTLOADER_H
+
+#include "exec/cpu-defs.h"
+
+void bl_gen_jump_to(uint32_t **p, target_ulong jump_addr);
+void bl_gen_jump_kernel(uint32_t **p, target_ulong sp, target_ulong a0,
+ target_ulong a1, target_ulong a2, target_ulong a3,
+ target_ulong kernel_addr);
+void bl_gen_write_ulong(uint32_t **p, target_ulong addr, target_ulong val);
+void bl_gen_write_u32(uint32_t **p, target_ulong addr, uint32_t val);
+void bl_gen_write_u64(uint32_t **p, target_ulong addr, uint64_t val);
+
+#endif