include/linux/of.h
Source file repositories/reference/linux-study-clean/include/linux/of.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/of.h- Extension
.h- Size
- 55432 bytes
- Lines
- 1876
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/bitops.hlinux/cleanup.hlinux/errno.hlinux/kobject.hlinux/mod_devicetable.hlinux/property.hlinux/list.hasm/byteorder.hasm/prom.h
Detected Declarations
struct propertystruct of_irq_controllerstruct device_nodestruct of_phandle_argsstruct of_phandle_iteratorstruct of_reconfig_datastruct kimagestruct of_changeset_entrystruct of_changesetstruct notifier_blockstruct of_overlay_notify_dataenum of_reconfig_changeenum of_overlay_notify_actionfunction of_node_releasefunction of_node_putfunction is_of_nodefunction of_node_is_rootfunction of_node_check_flagfunction of_node_test_and_set_flagfunction of_node_set_flagfunction of_node_clear_flagfunction of_property_check_flagfunction of_property_set_flagfunction of_property_clear_flagfunction of_read_numberfunction of_read_ulongfunction of_machine_is_compatiblefunction of_core_initfunction of_node_name_eqfunction of_node_name_prefixfunction of_node_full_namefunction of_device_is_compatiblefunction of_device_compatible_matchfunction of_device_is_availablefunction of_device_is_big_endianfunction of_property_read_boolfunction of_property_count_elems_of_sizefunction of_property_read_u8_indexfunction of_property_read_u16_indexfunction of_property_read_u32_indexfunction of_property_read_u64_indexfunction of_cpu_node_to_idfunction of_n_addr_cellsfunction of_n_size_cellsfunction of_property_read_variable_u8_arrayfunction of_property_read_variable_u16_arrayfunction of_property_read_variable_u32_arrayfunction of_property_read_u64
Annotated Snippet
struct property {
char *name;
int length;
void *value;
struct property *next;
#if defined(CONFIG_OF_DYNAMIC) || defined(CONFIG_SPARC)
unsigned long _flags;
#endif
#if defined(CONFIG_OF_PROMTREE)
unsigned int unique_id;
#endif
#if defined(CONFIG_OF_KOBJ)
struct bin_attribute attr;
#endif
};
#if defined(CONFIG_SPARC)
struct of_irq_controller;
#endif
struct device_node {
const char *name;
phandle phandle;
const char *full_name;
struct fwnode_handle fwnode;
struct property *properties;
struct property *deadprops; /* removed properties */
struct device_node *parent;
struct device_node *child;
struct device_node *sibling;
#if defined(CONFIG_OF_KOBJ)
struct kobject kobj;
#endif
unsigned long _flags;
void *data;
#if defined(CONFIG_SPARC)
unsigned int unique_id;
struct of_irq_controller *irq_trans;
#endif
};
#define MAX_PHANDLE_ARGS NR_FWNODE_REFERENCE_ARGS
struct of_phandle_args {
struct device_node *np;
int args_count;
uint32_t args[MAX_PHANDLE_ARGS];
};
struct of_phandle_iterator {
/* Common iterator information */
const char *cells_name;
int cell_count;
const struct device_node *parent;
/* List size information */
const __be32 *list_end;
const __be32 *phandle_end;
/* Current position state */
const __be32 *cur;
uint32_t cur_count;
phandle phandle;
struct device_node *node;
};
struct of_reconfig_data {
struct device_node *dn;
struct property *prop;
struct property *old_prop;
};
extern const struct kobj_type of_node_ktype;
extern const struct fwnode_operations of_fwnode_ops;
/**
* of_node_init - initialize a devicetree node
* @node: Pointer to device node that has been created by kzalloc()
*
* On return the device_node refcount is set to one. Use of_node_put()
* on @node when done to free the memory allocated for it. If the node
* is NOT a dynamic node the memory will not be freed. The decision of
* whether to free the memory will be done by node->release(), which is
* of_node_release().
*/
static inline void of_node_init(struct device_node *node)
{
#if defined(CONFIG_OF_KOBJ)
kobject_init(&node->kobj, &of_node_ktype);
#endif
Annotation
- Immediate include surface: `linux/types.h`, `linux/bitops.h`, `linux/cleanup.h`, `linux/errno.h`, `linux/kobject.h`, `linux/mod_devicetable.h`, `linux/property.h`, `linux/list.h`.
- Detected declarations: `struct property`, `struct of_irq_controller`, `struct device_node`, `struct of_phandle_args`, `struct of_phandle_iterator`, `struct of_reconfig_data`, `struct kimage`, `struct of_changeset_entry`, `struct of_changeset`, `struct notifier_block`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.