aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSong Gao <gaosong@loongson.cn>2024-04-26 17:15:35 +0800
committerSong Gao <gaosong@loongson.cn>2024-04-29 10:25:56 +0800
commitd771ca1c10ab146eae676dd6a6975a8f7cf84d65 (patch)
tree0b00d4e50e6339caf7a075f4da8093e4f3f5f93a /include
parentfd87be1dada5672f877e03c2ca8504458292c479 (diff)
downloadqemu-d771ca1c10ab146eae676dd6a6975a8f7cf84d65.zip
qemu-d771ca1c10ab146eae676dd6a6975a8f7cf84d65.tar.gz
qemu-d771ca1c10ab146eae676dd6a6975a8f7cf84d65.tar.bz2
hw/loongarch: Move boot functions to boot.c
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20240426091551.2397867-2-gaosong@loongson.cn>
Diffstat (limited to 'include')
-rw-r--r--include/hw/loongarch/boot.h21
-rw-r--r--include/hw/loongarch/virt.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/include/hw/loongarch/boot.h b/include/hw/loongarch/boot.h
new file mode 100644
index 0000000..3275c1e
--- /dev/null
+++ b/include/hw/loongarch/boot.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Definitions for LoongArch boot.
+ *
+ * Copyright (C) 2023 Loongson Technology Corporation Limited
+ */
+
+#ifndef HW_LOONGARCH_BOOT_H
+#define HW_LOONGARCH_BOOT_H
+
+struct loongarch_boot_info {
+ uint64_t ram_size;
+ const char *kernel_filename;
+ const char *kernel_cmdline;
+ const char *initrd_filename;
+ uint64_t a0, a1, a2;
+};
+
+void loongarch_load_kernel(MachineState *ms, struct loongarch_boot_info *info);
+
+#endif /* HW_LOONGARCH_BOOT_H */
diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
index 252f7df..cf2f2bf 100644
--- a/include/hw/loongarch/virt.h
+++ b/include/hw/loongarch/virt.h
@@ -13,6 +13,7 @@
#include "qemu/queue.h"
#include "hw/intc/loongarch_ipi.h"
#include "hw/block/flash.h"
+#include "hw/loongarch/boot.h"
#define LOONGARCH_MAX_CPUS 256
@@ -55,6 +56,7 @@ struct LoongArchMachineState {
MemoryRegion system_iocsr;
MemoryRegion iocsr_mem;
AddressSpace as_iocsr;
+ struct loongarch_boot_info bootinfo;
};
#define TYPE_LOONGARCH_MACHINE MACHINE_TYPE_NAME("virt")