scripts/dtc/libfdt/fdt_sw.c
Source file repositories/reference/linux-study-clean/scripts/dtc/libfdt/fdt_sw.c
File Facts
- System
- Linux kernel
- Corpus path
scripts/dtc/libfdt/fdt_sw.c- Extension
.c- Size
- 8671 bytes
- Lines
- 385
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
libfdt_env.hfdt.hlibfdt.hlibfdt_internal.h
Detected Declarations
function Copyrightfunction fdt_add_reservemap_entryfunction fdt_begin_nodefunction sw_flagsfunction fdt_create_with_flagsfunction fdt_createfunction fdt_resizefunction fdt_add_reservemap_entryfunction fdt_finish_reservemapfunction fdt_begin_nodefunction fdt_end_nodefunction fdt_add_string_function fdt_del_last_string_function fdt_find_add_string_function fdt_property_placeholderfunction fdt_propertyfunction fdt_finish
Annotated Snippet
if (tag == FDT_PROP) {
struct fdt_property *prop =
fdt_offset_ptr_w_(fdt, offset);
int nameoff;
nameoff = fdt32_to_cpu(prop->nameoff);
nameoff += fdt_size_dt_strings(fdt);
prop->nameoff = cpu_to_fdt32(nameoff);
}
offset = nextoffset;
}
if (nextoffset < 0)
return nextoffset;
/* Finally, adjust the header */
fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
/* And fix up fields that were keeping intermediate state. */
fdt_set_last_comp_version(fdt, FDT_LAST_COMPATIBLE_VERSION);
fdt_set_magic(fdt, FDT_MAGIC);
return 0;
}
Annotation
- Immediate include surface: `libfdt_env.h`, `fdt.h`, `libfdt.h`, `libfdt_internal.h`.
- Detected declarations: `function Copyright`, `function fdt_add_reservemap_entry`, `function fdt_begin_node`, `function sw_flags`, `function fdt_create_with_flags`, `function fdt_create`, `function fdt_resize`, `function fdt_add_reservemap_entry`, `function fdt_finish_reservemap`, `function fdt_begin_node`.
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.