libfdt: Rename and publish _fdt_next_tag()

Although it's a low-level function that shouldn't normally be needed,
there are circumstances where it's useful for users of libfdt to use
the _fdt_next_tag() function.  Therefore, this patch renames it to
fdt_next_tag() and publishes it in libfdt.h.

In addition, this patch adds a new testcase using fdt_next_tag(),
dtbs_equal_ordered.  This testcase tests for structural equality of
two dtbs, including the order of properties and subnodes, but ignoring
NOP tags, the order of the dtb sections and the layout of strings in
the strings block.  This will be useful for testing other dtc
functionality in the future.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2007-10-24 11:06:09 +10:00 committed by Jon Loeliger
parent 96b5fad3a1
commit 3c44c87bde
10 changed files with 162 additions and 21 deletions

View file

@ -100,12 +100,12 @@ int _fdt_node_end_offset(void *fdt, int nodeoffset)
uint32_t tag;
int offset, nextoffset;
tag = _fdt_next_tag(fdt, nodeoffset, &nextoffset);
tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
if (tag != FDT_BEGIN_NODE)
return -FDT_ERR_BADOFFSET;
do {
offset = nextoffset;
tag = _fdt_next_tag(fdt, offset, &nextoffset);
tag = fdt_next_tag(fdt, offset, &nextoffset);
switch (tag) {
case FDT_END: