On 6/11/25 1:53 PM, Orzel, Michal wrote:
On 11/06/2025 13:44, Oleksii Kurochko wrote:
There is nothing Arm specific for these functions thereby it makes sense
to move their declarations to common header: xen/device_tree.h.
I find it a bit odd that you don't mention that the definitions are already in
common and therefore the prototypes should be too. For me that's the main reason
(in fact the prototypes should have been moved together with definitions).
Initially I mentioned that they are used in common
code:https://gitlab.com/xen-project/people/olkur/xen/-/commit/db46a683342421375c01a71317deb5a8840ae624
and by that I also mean that they are defined. But then decicded to re-write a
commit
message.
I will send a v2 with updated commit message:
The definitions of|device_tree_get_reg()| and|device_tree_get_u32()| are
already in
common code, so move their prototypes there as well.
Signed-off-by: Oleksii Kurochko<oleksii.kuroc...@gmail.com>
Reviewed-by: Michal Orzel<michal.or...@amd.com>
Thanks.
~ Oleksii
---
xen/arch/arm/include/asm/setup.h | 6 ------
xen/include/xen/device_tree.h | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 6cf272c160..2b58549c1a 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -53,12 +53,6 @@ void setup_mm(void);
extern uint32_t hyp_traps_vector[];
void init_traps(void);
-void device_tree_get_reg(const __be32 **cell, uint32_t address_cells,
- uint32_t size_cells, paddr_t *start, paddr_t *size);
-
-u32 device_tree_get_u32(const void *fdt, int node,
- const char *prop_name, u32 dflt);
-
int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t
p2mt,
struct rangeset *iomem_ranges, struct rangeset *irq_ranges);
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 6dc1fb5159..75017e4266 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -949,6 +949,12 @@ int dt_get_pci_domain_nr(struct dt_device_node *node);
struct dt_device_node *dt_find_node_by_phandle(dt_phandle handle);
+void device_tree_get_reg(const __be32 **cell, uint32_t address_cells,
+ uint32_t size_cells, paddr_t *start, paddr_t *size);
+
+u32 device_tree_get_u32(const void *fdt, int node,
+ const char *prop_name, u32 dflt);
+
#ifdef CONFIG_DEVICE_TREE_DEBUG
#define dt_dprintk(fmt, args...) \
printk(XENLOG_DEBUG fmt, ## args)