fdt_next_tag(9)
π fdt_next_tag β get next tag in the device tree π
okay so bestie, we're in the Kernel API Manual today and the star of the show is fdt_next_tag(9). it's a lil function that walks the device tree blob tag by tag, and honestly? it's giving tour guide energy. π§β¨
πΈ NAME πΈ
fdt_next_tag β get next tag in the device tree. that's it. that's the whole vibe. π
β¨ SYNOPSIS β¨
uint32_t fdt_next_tag (const void *fdt , int offset , int *nextoffset );
three args, one uint32_t coming back at you. no cap. π
π«Ά ARGUMENTS π«Ά
fdtβ Pointer to the device tree blob. like, the actual blob. hand it over. π¦offsetβ Offset within the blob to start searching. where in the blob you wanna start poking around. πnextoffsetβ Pointer to variable to store the offset of the next tag. it's a pointer-to-int, so the function can write back to you. main character behaviour fr fr. π
π DESCRIPTION π
so fdt_next_tag returns the tag type of the next tag in the device tree blob, starting from the given offset. it literally just peeks at the next tag and tells you what kind it is. π
and here's the cute part: if nextoffset is non-NULL, it gets set to the offset immediately following the tag. so you can chain calls and walk the whole tree, one tag at a time. it's giving "pass the aux" energy. π§β¨
ngl,nextoffsetbeing non-NULL is the whole detail β if it isNULL, nothing gets written there. don't be weird about it. π«Ά
π₯ RETURN π₯
it returns the tag type, which is one of these icons:
FDT_BEGIN_NODEFDT_END_NODEFDT_PROPFDT_NOPFDT_END
and if offset is out of bounds, you get FDT_END. that's the "bestie you've gone too far" signal. π
π SEE ALSO π
okay this list is long long, but every single one of these is a real friend of the family, so here we go. the kernel file in question is ./scripts/dtc/libfdt/libfdt.h β that's the home base. π
walking the tree: fdt_offset_ptr(9), fdt_first_subnode(9), fdt_next_subnode(9), fdt_for_each_subnode(9)
header business: fdt_header_size(9), fdt_header_size_(9), fdt_check_header(9), fdt_move(9), fdt_check_full(9)
strings: fdt_get_string(9), fdt_string(9)
phandles: fdt_find_max_phandle(9), fdt_get_max_phandle(9), fdt_generate_phandle(9), fdt_get_phandle(9)
memory reserve map: fdt_num_mem_rsv(9), fdt_get_mem_rsv(9), fdt_add_mem_rsv(9), fdt_del_mem_rsv(9)
subnodes & paths: fdt_subnode_offset_namelen(9), fdt_subnode_offset(9), fdt_path_offset_namelen(9), fdt_path_offset(9), fdt_get_name(9), fdt_get_path(9), fdt_supernode_atdepth_offset(9), fdt_node_depth(9), fdt_parent_offset(9)
properties: fdt_first_property_offset(9), fdt_next_property_offset(9), fdt_for_each_property_offset(9), fdt_get_property_by_offset(9), fdt_get_property_namelen(9), fdt_get_property(9), fdt_getprop_by_offset(9), fdt_getprop_namelen(9), fdt_getprop(9), fdt_nop_property(9)
aliases & symbols: fdt_get_alias_namelen(9), fdt_get_alias(9), fdt_get_symbol_namelen(9), fdt_get_symbol(9)
finding nodes: fdt_node_offset_by_prop_value(9), fdt_node_offset_by_phandle(9), fdt_node_check_compatible(9), fdt_node_offset_by_compatible(9)
stringlists: fdt_stringlist_contains(9), fdt_stringlist_count(9), fdt_stringlist_search(9), fdt_stringlist_get(9)
cells: FDT_MAX_NCELLS(9), fdt_address_cells(9), fdt_size_cells(9)
setprop in place: fdt_setprop_inplace_namelen_partial(9), fdt_setprop_inplace(9), fdt_setprop_inplace_u32(9), fdt_setprop_inplace_u64(9), fdt_setprop_inplace_cell(9)
nop: fdt_nop_node(9)
creating & resizing: fdt_create_with_flags(9), fdt_create(9), fdt_resize(9), fdt_create_empty_tree(9), fdt_open_into(9), fdt_pack(9)
reserve map building: fdt_add_reservemap_entry(9), fdt_finish_reservemap(9)
building a tree: fdt_begin_node(9), fdt_property(9), fdt_property_placeholder(9), fdt_end_node(9), fdt_finish(9)
naming & setting props: fdt_set_name(9), fdt_setprop_namelen(9), fdt_setprop(9), fdt_setprop_placeholder_namelen(9), fdt_setprop_placeholder(9), fdt_setprop_u32(9), fdt_setprop_u64(9), fdt_setprop_cell(9), fdt_setprop_string(9), fdt_setprop_namelen_string(9), fdt_setprop_empty(9)
appending props: fdt_appendprop(9), fdt_appendprop_u32(9), fdt_appendprop_u64(9), fdt_appendprop_cell(9), fdt_appendprop_string(9), fdt_appendprop_addrrange(9)
deleting stuff: fdt_delprop(9), fdt_del_node(9)
subnode add: fdt_add_subnode_namelen(9), fdt_add_subnode(9)
overlays: fdt_overlay_apply(9), fdt_overlay_target_offset(9)
errors: fdt_strerror(9)
and that's the whole page bestie, you ate that π β¨
this masterpiece lives in ./scripts/dtc/libfdt and it's dated October 2026 β mwah, sending kisses, bye! πππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms