aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu
diff options
context:
space:
mode:
authorEric Auger <eric.auger@linaro.org>2016-02-19 09:42:29 -0700
committerAlex Williamson <alex.williamson@redhat.com>2016-02-19 09:42:29 -0700
commit60e43e987c3d188855dc7e95ff4979be78db3574 (patch)
tree3df464614d85b0c721c0b84af71721dff9faa4f0 /include/sysemu
parent62d9551247a2db3937d99e5495bc36b32abb41be (diff)
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 <eric.auger@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r--include/sysemu/device_tree.h8
1 files changed, 8 insertions, 0 deletions
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);