From 60e43e987c3d188855dc7e95ff4979be78db3574 Mon Sep 17 00:00:00 2001 From: Eric Auger Date: Fri, 19 Feb 2016 09:42:29 -0700 Subject: device_tree: introduce load_device_tree_from_sysfs This function returns the host device tree blob from sysfs (/proc/device-tree). It uses a recursive function inspired from dtc read_fstree. Signed-off-by: Eric Auger Reviewed-by: Peter Maydell Signed-off-by: Alex Williamson --- include/sysemu/device_tree.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index 359e14304f..62093bad7c 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -16,6 +16,14 @@ void *create_device_tree(int *sizep); void *load_device_tree(const char *filename_path, int *sizep); +#ifdef CONFIG_LINUX +/** + * load_device_tree_from_sysfs: reads the device tree information in the + * /proc/device-tree directory and return the corresponding binary blob + * buffer pointer. Asserts in case of error. + */ +void *load_device_tree_from_sysfs(void); +#endif int qemu_fdt_setprop(void *fdt, const char *node_path, const char *property, const void *val, int size); -- cgit v1.2.3