|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] device-tree: Move domain_fdt_begin_node() to common
commit 9b29c4ad0bc845ca3612ca5d38161138619ab8f7
Author: Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Tue Jun 3 12:03:27 2025 +0200
Commit: Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Wed Jun 4 09:02:21 2025 +0200
device-tree: Move domain_fdt_begin_node() to common
This is just a wrapper around fdt_begin_node(). Move it to common and
remove asm/domain_build.h inclusion from static-shmem.c.
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
xen/arch/arm/domain_build.c | 32 --------------------------------
xen/arch/arm/include/asm/domain_build.h | 1 -
xen/arch/arm/static-shmem.c | 1 -
xen/common/device-tree/bootfdt.c | 32 ++++++++++++++++++++++++++++++++
xen/include/xen/bootfdt.h | 1 +
5 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index b189a7cfae..068af31a62 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -649,38 +649,6 @@ static int __init fdt_property_interrupts(const struct
kernel_info *kinfo,
return res;
}
-/*
- * Wrapper to convert physical address from paddr_t to uint64_t and
- * invoke fdt_begin_node(). This is required as the physical address
- * provided as part of node name should not contain any leading
- * zeroes. Thus, one should use PRIx64 (instead of PRIpaddr) to append
- * unit (which contains the physical address) with name to generate a
- * node name.
- */
-int __init domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit)
-{
- /*
- * The size of the buffer to hold the longest possible string (i.e.
- * interrupt-controller@ + a 64-bit number + \0).
- */
- char buf[38];
- int ret;
-
- /* ePAPR 3.4 */
- ret = snprintf(buf, sizeof(buf), "%s@%"PRIx64, name, unit);
-
- if ( ret >= sizeof(buf) )
- {
- printk(XENLOG_ERR
- "Insufficient buffer. Minimum size required is %d\n",
- (ret + 1));
-
- return -FDT_ERR_TRUNCATED;
- }
-
- return fdt_begin_node(fdt, buf);
-}
-
int __init make_memory_node(const struct kernel_info *kinfo, int addrcells,
int sizecells, const struct membanks *mem)
{
diff --git a/xen/arch/arm/include/asm/domain_build.h
b/xen/arch/arm/include/asm/domain_build.h
index 9655e9d453..c6fec3168c 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -5,7 +5,6 @@
#include <xen/sched.h>
typedef __be32 gic_interrupt_t[3];
-int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
int make_psci_node(void *fdt);
void evtchn_allocate(struct domain *d);
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index 32ec6d4bc6..21fd2c3cd4 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -6,7 +6,6 @@
#include <xen/rangeset.h>
#include <xen/sched.h>
-#include <asm/domain_build.h>
#include <asm/setup.h>
#include <asm/static-memory.h>
#include <asm/static-shmem.h>
diff --git a/xen/common/device-tree/bootfdt.c b/xen/common/device-tree/bootfdt.c
index 529c91e603..aa44f5a67c 100644
--- a/xen/common/device-tree/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -659,6 +659,38 @@ const __init char *boot_fdt_cmdline(const void *fdt)
return prop->data;
}
+/*
+ * Wrapper to convert physical address from paddr_t to uint64_t and
+ * invoke fdt_begin_node(). This is required as the physical address
+ * provided as part of node name should not contain any leading
+ * zeroes. Thus, one should use PRIx64 (instead of PRIpaddr) to append
+ * unit (which contains the physical address) with name to generate a
+ * node name.
+ */
+int __init domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit)
+{
+ /*
+ * The size of the buffer to hold the longest possible string (i.e.
+ * interrupt-controller@ + a 64-bit number + \0).
+ */
+ char buf[38];
+ int ret;
+
+ /* ePAPR 3.4 */
+ ret = snprintf(buf, sizeof(buf), "%s@%"PRIx64, name, unit);
+
+ if ( ret >= sizeof(buf) )
+ {
+ printk(XENLOG_ERR
+ "Insufficient buffer. Minimum size required is %d\n",
+ (ret + 1));
+
+ return -FDT_ERR_TRUNCATED;
+ }
+
+ return fdt_begin_node(fdt, buf);
+}
+
/*
* Local variables:
* mode: C
diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
index 847f019559..64db48f4fe 100644
--- a/xen/include/xen/bootfdt.h
+++ b/xen/include/xen/bootfdt.h
@@ -191,6 +191,7 @@ void populate_boot_allocator(void);
size_t boot_fdt_info(const void *fdt, paddr_t paddr);
const char *boot_fdt_cmdline(const void *fdt);
+int domain_fdt_begin_node(void *fdt, const char *name, uint64_t unit);
static inline struct membanks *bootinfo_get_reserved_mem(void)
{
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |