|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/dom0less: move make_chosen_node() to common code
commit 06cb86d37454e8c3b576b68c102ef6215301f83a
Author: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
AuthorDate: Thu Nov 27 17:26:15 2025 +0100
Commit: Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Fri Nov 28 10:26:00 2025 +0100
xen/dom0less: move make_chosen_node() to common code
The current implementation of make_chosen_node() does not contain any
architecture-specific logic. Therefore, move it from arch-specific
files to common code.
At this stage, there is no need to introduce an arch_make_chosen_node(),
as no architecture-specific customization is required.
This change avoids duplication and simplifies future maintenance for
architectures like RISC-V and ARM.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Acked-by: Michal Orzel <michal.orzel@xxxxxxx>
---
xen/arch/arm/domain_build.c | 46 -----------------------------------
xen/common/device-tree/domain-build.c | 46 +++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index fb8fbb1650..6d1c9583b1 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1510,52 +1510,6 @@ int __init make_timer_node(const struct kernel_info
*kinfo)
return res;
}
-/*
- * This function is used as part of the device tree generation for Dom0
- * on ACPI systems, and DomUs started directly from Xen based on device
- * tree information.
- */
-int __init make_chosen_node(const struct kernel_info *kinfo)
-{
- int res;
- const char *bootargs = NULL;
- const struct boot_module *initrd = kinfo->bd.initrd;
- void *fdt = kinfo->fdt;
-
- dt_dprintk("Create chosen node\n");
- res = fdt_begin_node(fdt, "chosen");
- if ( res )
- return res;
-
- if ( kinfo->bd.cmdline && kinfo->bd.cmdline[0] )
- {
- bootargs = &kinfo->bd.cmdline[0];
- res = fdt_property(fdt, "bootargs", bootargs, strlen(bootargs) + 1);
- if ( res )
- return res;
- }
-
- /*
- * If the bootloader provides an initrd, we must create a placeholder
- * for the initrd properties. The values will be replaced later.
- */
- if ( initrd && initrd->size )
- {
- u64 a = 0;
- res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
- if ( res )
- return res;
-
- res = fdt_property(kinfo->fdt, "linux,initrd-end", &a, sizeof(a));
- if ( res )
- return res;
- }
-
- res = fdt_end_node(fdt);
-
- return res;
-}
-
static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
struct dt_device_node *node,
p2m_type_t p2mt)
diff --git a/xen/common/device-tree/domain-build.c
b/xen/common/device-tree/domain-build.c
index 95b383e00f..774790aab3 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -405,6 +405,52 @@ void __init initrd_load(struct kernel_info *kinfo,
iounmap(initrd);
}
+/*
+ * This function is used as part of the device tree generation for Dom0
+ * on ACPI systems (on platform where CONFIG_ACPI=y), and DomUs started
+ * directly from Xen based on device tree information.
+ */
+int __init make_chosen_node(const struct kernel_info *kinfo)
+{
+ int res;
+ const char *bootargs = NULL;
+ const struct boot_module *initrd = kinfo->bd.initrd;
+ void *fdt = kinfo->fdt;
+
+ dt_dprintk("Create chosen node\n");
+ res = fdt_begin_node(fdt, "chosen");
+ if ( res )
+ return res;
+
+ if ( kinfo->bd.cmdline && kinfo->bd.cmdline[0] )
+ {
+ bootargs = &kinfo->bd.cmdline[0];
+ res = fdt_property(fdt, "bootargs", bootargs, strlen(bootargs) + 1);
+ if ( res )
+ return res;
+ }
+
+ /*
+ * If the bootloader provides an initrd, we must create a placeholder
+ * for the initrd properties. The values will be replaced later.
+ */
+ if ( initrd && initrd->size )
+ {
+ u64 a = 0;
+ res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
+ if ( res )
+ return res;
+
+ res = fdt_property(kinfo->fdt, "linux,initrd-end", &a, sizeof(a));
+ if ( res )
+ return res;
+ }
+
+ res = fdt_end_node(fdt);
+
+ return res;
+}
+
/*
* Local variables:
* mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |