summaryrefslogtreecommitdiffstats
path: root/cpukit/include/libfdt.h
diff options
context:
space:
mode:
authorPantelis Antoniou <pantelis.antoniou@konsulko.com>2017-07-27 19:33:11 +0300
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-19 07:01:11 +0200
commita1c3b41a6447de79b3b137a9e9b56834f8d9d88a (patch)
tree4e5a2090dea23123aa4c23a15a69405b09dd26d7 /cpukit/include/libfdt.h
parentFix a few whitespace and style nits (diff)
downloadrtems-a1c3b41a6447de79b3b137a9e9b56834f8d9d88a.tar.bz2
Introduce fdt_setprop_placeholder() method
In some cases you need to add a property but the contents of it are not known at creation time, merely the extend of it. This method allows you to create a property of a given size (filled with garbage) while a pointer to the property data will be provided. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> [dwg: Corrected commit message] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cpukit/include/libfdt.h')
-rw-r--r--cpukit/include/libfdt.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h
index a248b1b57a..313c72a2d1 100644
--- a/cpukit/include/libfdt.h
+++ b/cpukit/include/libfdt.h
@@ -1449,6 +1449,37 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
/**
+ * fdt_setprop _placeholder - allocate space for a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @len: length of the property value
+ * @prop_data: return pointer to property data
+ *
+ * fdt_setprop_placeholer() allocates the named property in the given node.
+ * If the property exists it is resized. In either case a pointer to the
+ * property data is returned.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ * contain the new property value
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
+ int len, void **prop_data);
+
+/**
* fdt_setprop_u32 - set a property to a 32-bit integer
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change