libfdt: Add fdt_check_full() function

This new function implements a complete and thorough check of an fdt blob's
structure.  Given a buffer containing an fdt, it should return 0 only if
the fdt within is structurally sound in all regards.  It doesn't check
anything about the blob's contents (i.e. the actual values of the nodes and
properties), of course.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
David Gibson 2018-03-18 00:12:12 +11:00
parent c14223fb22
commit 4b8fcc3d01
7 changed files with 141 additions and 1 deletions

View file

@ -298,6 +298,8 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
/* Read-only functions */
/**********************************************************************/
int fdt_check_full(const void *fdt, size_t bufsize);
/**
* fdt_get_string - retrieve a string from the strings block of a device tree
* @fdt: pointer to the device tree blob