[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 09/11] x86, arm, riscv: add per-arch bootinfo headers to allow x86 boot include



The <xen/bootinfo.h> header contains structures that will be used in efi
logic prior to the main start of Xen, so will soon be included in Arm
builds. This same header will also used in early x86 boot, where asm/*
headers are not reachable and yet it contains a needed include of
<asm/bootinfo.h>, so...

Add initial per-arch <asm/bootinfo.h> headers to Arm and RISC-V so that
inclusion of <asm/bootinfo.h> succeeds in each main arch build and then
gate that inclusion from <xen/bootinfo.h> on CONFIG variables so that it
does not take effect in the early x86 boot build where CONFIG_X86 is not
defined to prevent build failure there. The early x86 boot logic can
then directly include asm/bootinfo.h via a specified directory path to
bring in the necessary definitions.

Is this fantastic? No. Does it help? Yep.

Signed-off-by: Christopher Clark <christopher.w.clark@xxxxxxxxx>
Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>

New for v2 series.
---
 xen/arch/arm/include/asm/bootinfo.h   | 20 ++++++++++++++++++++
 xen/arch/riscv/include/asm/bootinfo.h | 20 ++++++++++++++++++++
 xen/include/xen/bootinfo.h            |  7 ++-----
 3 files changed, 42 insertions(+), 5 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/bootinfo.h
 create mode 100644 xen/arch/riscv/include/asm/bootinfo.h

diff --git a/xen/arch/arm/include/asm/bootinfo.h 
b/xen/arch/arm/include/asm/bootinfo.h
new file mode 100644
index 0000000000..5316c87a3d
--- /dev/null
+++ b/xen/arch/arm/include/asm/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __ARCH_ARM_BOOTINFO_H__
+#define __ARCH_ARM_BOOTINFO_H__
+
+struct __packed arch_bootmodule { };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
+
+struct __packed arch_boot_info { };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/riscv/include/asm/bootinfo.h 
b/xen/arch/riscv/include/asm/bootinfo.h
new file mode 100644
index 0000000000..5316c87a3d
--- /dev/null
+++ b/xen/arch/riscv/include/asm/bootinfo.h
@@ -0,0 +1,20 @@
+#ifndef __ARCH_ARM_BOOTINFO_H__
+#define __ARCH_ARM_BOOTINFO_H__
+
+struct __packed arch_bootmodule { };
+DEFINE_STRUCT_PTR_TYPE(arch_bootmodule);
+
+struct __packed arch_boot_info { };
+DEFINE_STRUCT_PTR_TYPE(arch_boot_info);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index 8389da4f72..bf5586a76b 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -5,11 +5,8 @@
 #include <xen/compiler.h>
 #include <xen/mm-frame.h>
 
-#ifdef CONFIG_X86
-#include <asm/bootinfo.h>
-#else
-    struct arch_bootmodule { };
-    struct arch_boot_info { };
+#if defined CONFIG_X86 || CONFIG_ARM || CONFIG_RISCV
+# include <asm/bootinfo.h>
 #endif
 
 /* Boot module binary type / purpose */
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.