scripts/dtc/dtc.h
Source file repositories/reference/linux-study-clean/scripts/dtc/dtc.h
File Facts
- System
- Linux kernel
- Corpus path
scripts/dtc/dtc.h- Extension
.h- Size
- 10422 bytes
- Lines
- 378
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hstring.hstdlib.hstdint.hstdbool.hstdarg.hassert.hctype.herrno.hunistd.hinttypes.hlibfdt_env.hfdt.hutil.h
Detected Declarations
struct markerstruct datastruct labelstruct bus_typestruct propertystruct nodestruct reserve_infostruct dt_infoenum markertypefunction phandle_is_validfunction dtb_ld16function dtb_ld32function dtb_ld64function strendsfunction is_type_markerfunction type_marker_length
Annotated Snippet
struct bus_type {
const char *name;
};
struct property {
bool deleted;
char *name;
struct data val;
struct property *next;
struct label *labels;
struct srcpos *srcpos;
};
struct node {
bool deleted;
char *name;
struct property *proplist;
struct node *children;
struct node *parent;
struct node *next_sibling;
char *fullpath;
size_t basenamelen;
cell_t phandle;
int addr_cells, size_cells;
struct label *labels;
const struct bus_type *bus;
struct srcpos *srcpos;
bool omit_if_unused, is_referenced;
};
#define for_each_label_withdel(l0, l) \
for ((l) = (l0); (l); (l) = (l)->next)
#define for_each_label(l0, l) \
for_each_label_withdel(l0, l) \
if (!(l)->deleted)
#define for_each_property_withdel(n, p) \
for ((p) = (n)->proplist; (p); (p) = (p)->next)
#define for_each_property(n, p) \
for_each_property_withdel(n, p) \
if (!(p)->deleted)
#define for_each_child_withdel(n, c) \
for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
#define for_each_child(n, c) \
for_each_child_withdel(n, c) \
if (!(c)->deleted)
void add_label(struct label **labels, char *label);
void delete_labels(struct label **labels);
struct property *build_property(const char *name, struct data val,
struct srcpos *srcpos);
struct property *build_property_delete(const char *name);
struct property *chain_property(struct property *first, struct property *list);
struct property *reverse_properties(struct property *first);
struct node *build_node(struct property *proplist, struct node *children,
struct srcpos *srcpos);
struct node *build_node_delete(struct srcpos *srcpos);
struct node *name_node(struct node *node, const char *name);
struct node *omit_node_if_unused(struct node *node);
struct node *reference_node(struct node *node);
struct node *chain_node(struct node *first, struct node *list);
struct node *merge_nodes(struct node *old_node, struct node *new_node);
struct node *add_orphan_node(struct node *old_node, struct node *new_node, char *ref);
void add_property(struct node *node, struct property *prop);
void delete_property_by_name(struct node *node, char *name);
void delete_property(struct property *prop);
void add_child(struct node *parent, struct node *child);
void delete_node_by_name(struct node *parent, char *name);
void delete_node(struct node *node);
void append_to_property(struct node *node,
char *name, const void *data, int len,
enum markertype type);
const char *get_unitname(struct node *node);
struct property *get_property(struct node *node, const char *propname);
cell_t propval_cell(struct property *prop);
Annotation
- Immediate include surface: `stdio.h`, `string.h`, `stdlib.h`, `stdint.h`, `stdbool.h`, `stdarg.h`, `assert.h`, `ctype.h`.
- Detected declarations: `struct marker`, `struct data`, `struct label`, `struct bus_type`, `struct property`, `struct node`, `struct reserve_info`, `struct dt_info`, `enum markertype`, `function phandle_is_valid`.
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: pattern 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.