hw/loongarch: move memory map to boot.c
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 May 2024 14:51:35 +0000 (16:51 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 8 May 2024 22:07:21 +0000 (00:07 +0200)
Ensure that it can be used even if virt.c is not included in the build, as
is the case for --without-default-devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240507145135.270803-1-pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
.gitlab-ci.d/buildtest.yml
hw/loongarch/boot.c
hw/loongarch/virt.c
include/hw/loongarch/boot.h
include/hw/loongarch/virt.h

index e9402a68a7939a5fada8e3d51bd2139f7c48a0aa..bab61945643241c026c4375a808f56c1e019b3cb 100644 (file)
@@ -650,7 +650,7 @@ build-tci:
 # Check our reduced build configurations
 # requires libfdt: aarch64, arm, i386, loongarch64, microblaze, microblazeel,
 #   mips64el, or1k, ppc, ppc64, riscv32, riscv64, rx, x86_64
-# does not build without boards: i386, loongarch64, s390x, sh4, sh4eb, x86_64
+# does not build without boards: i386, s390x, sh4, sh4eb, x86_64
 build-without-defaults:
   extends: .native_build_job_template
   needs:
index 7d1630b2e7485cac08cbaab48d27ad93648a446c..03f6301a7730069e5e1d508210ecc9ded64dd459 100644 (file)
@@ -15,6 +15,9 @@
 #include "sysemu/reset.h"
 #include "sysemu/qtest.h"
 
+struct memmap_entry *memmap_table;
+unsigned memmap_entries;
+
 ram_addr_t initrd_offset;
 uint64_t initrd_size;
 
index c0999878df6a2b4b1469422a5608db30e6323965..504e1fb349d0b08321001f4e6c871420c108bc30 100644 (file)
@@ -516,9 +516,6 @@ static void virt_powerdown_req(Notifier *notifier, void *opaque)
     acpi_send_event(s->acpi_ged, ACPI_POWER_DOWN_STATUS);
 }
 
-struct memmap_entry *memmap_table;
-unsigned memmap_entries;
-
 static void memmap_add_entry(uint64_t address, uint64_t length, uint32_t type)
 {
     /* Ensure there are no duplicate entries. */
index 4ebcc89dcf203a5f0a298ff50e52a27b081ab4ab..b3b870df1f097662dff7fc7c173f152da583d374 100644 (file)
@@ -104,6 +104,16 @@ struct loongarch_boot_info {
     uint64_t a0, a1, a2;
 };
 
+extern struct memmap_entry *memmap_table;
+extern unsigned memmap_entries;
+
+struct memmap_entry {
+    uint64_t address;
+    uint64_t length;
+    uint32_t type;
+    uint32_t reserved;
+};
+
 void loongarch_load_kernel(MachineState *ms, struct loongarch_boot_info *info);
 
 #endif /* HW_LOONGARCH_BOOT_H */
index 4e14bf6060d015d3522c2f879de9742a39c69f26..fdbd2b146f14c5cdfb80bf54a9930bc42b2d7e47 100644 (file)
 
 #define FDT_BASE                0x100000
 
-extern struct memmap_entry *memmap_table;
-extern unsigned memmap_entries;
-
-struct memmap_entry {
-    uint64_t address;
-    uint64_t length;
-    uint32_t type;
-    uint32_t reserved;
-};
-
 struct LoongArchMachineState {
     /*< private >*/
     MachineState parent_obj;