This patch adds some internal documentation in libfdt.h, in the form
of comments on the error codes and some functions. Only a couple of
functions are covered so far, leaving the documentation still woefully
inadequate, but hey, it's a start.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* fdt_string - retreive a string from the strings block of a device tree
* @fdt: pointer to the device tree blob
* @stroffset: offset of the string within the strings block (native endian)
*
* fdt_string() retrieves a pointer to a single string from the
* strings block of the device tree blob at fdt.
*
* returns:
* a pointer to the string, on success
* NULL, if stroffset is out of bounds
*/
const char *fdt_string(const void *fdt, int stroffset);
int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
/**
* fdt_num_mem_rsv - retreive the number of memory reserve map entries
* @fdt: pointer to the device tree blob
*
* Returns the number of entries in the device tree blob's memory
* reservation map. This does not include the terminating 0,0 entry
* or any other (0,0) entries reserved for expansion.
*
* returns:
* the number of entries
*/
int fdt_num_mem_rsv(const void *fdt);
/**
* fdt_get_mem_rsv - retreive one memory reserve map entry
* @fdt: pointer to the device tree blob
* @address, @size: pointers to 64-bit variables
*
* On success, *address and *size will contain the address and size of
* the n-th reserve map entry from the device tree blob, in
* native-endian format.
*
* returns:
* 0, on success
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
const char *name, int namelen);
int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
@ -164,7 +280,10 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
@@ -164,7 +280,10 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
int fdt_open_into(void *fdt, void *buf, int bufsize);
int fdt_pack(void *fdt);
@ -215,7 +340,10 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
@@ -215,7 +340,10 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
int fdt_add_subnode(void *fdt, int parentoffset, const char *name);