include/linux/property.h
Source file repositories/reference/linux-study-clean/include/linux/property.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/property.h- Extension
.h- Size
- 22397 bytes
- Lines
- 620
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/args.hlinux/array_size.hlinux/bits.hlinux/cleanup.hlinux/fwnode.hlinux/stddef.hlinux/types.hlinux/util_macros.h
Detected Declarations
struct devicestruct software_nodestruct software_node_ref_argsstruct property_entrystruct software_nodeenum dev_prop_typefunction fwnode_device_is_big_endianfunction fwnode_device_is_compatiblefunction device_is_big_endianfunction device_is_compatiblefunction device_property_match_property_stringfunction device_for_each_child_nodefunction device_get_child_node_countfunction device_get_named_child_node_countfunction device_property_read_u8function device_property_read_u16function device_property_read_u32function device_property_read_u64function device_property_count_u8function device_property_count_u16function device_property_count_u32function device_property_count_u64function device_property_string_array_countfunction fwnode_property_read_u8function fwnode_property_read_u16function fwnode_property_read_u32function fwnode_property_read_u64function fwnode_property_count_u8function fwnode_property_count_u16function fwnode_property_count_u32function fwnode_property_count_u64function fwnode_property_string_array_countfunction fwnode_graph_is_endpoint
Annotated Snippet
struct software_node_ref_args {
const struct software_node *swnode;
struct fwnode_handle *fwnode;
unsigned int nargs;
u64 args[NR_FWNODE_REFERENCE_ARGS];
};
#define SOFTWARE_NODE_REFERENCE(_ref_, ...) \
(const struct software_node_ref_args) { \
.swnode = _Generic(_ref_, \
const struct software_node *: _ref_, \
struct software_node *: _ref_, \
default: NULL), \
.fwnode = _Generic(_ref_, \
struct fwnode_handle *: _ref_, \
default: NULL), \
.nargs = COUNT_ARGS(__VA_ARGS__), \
.args = { __VA_ARGS__ }, \
}
/**
* struct property_entry - "Built-in" device property representation.
* @name: Name of the property.
* @length: Length of data making up the value.
* @is_inline: True when the property value is stored inline.
* @type: Type of the data in unions.
* @pointer: Pointer to the property when it is not stored inline.
* @value: Value of the property when it is stored inline.
*/
struct property_entry {
const char *name;
size_t length;
bool is_inline;
enum dev_prop_type type;
union {
const void *pointer;
union {
u8 u8_data[sizeof(u64) / sizeof(u8)];
u16 u16_data[sizeof(u64) / sizeof(u16)];
u32 u32_data[sizeof(u64) / sizeof(u32)];
u64 u64_data[sizeof(u64) / sizeof(u64)];
const char *str[sizeof(u64) / sizeof(char *)];
} value;
};
};
/*
* Note: the below initializers for the anonymous union are carefully
* crafted to avoid gcc-4.4.4's problems with initialization of anon unions
* and structs.
*/
#define __PROPERTY_ENTRY_ARRAY_LEN(_name_, _elem_, _Type_, _val_, _len_) \
(struct property_entry) { \
.name = _name_, \
.length = (_len_) * sizeof_field(struct property_entry, value._elem_[0]), \
.type = DEV_PROP_##_Type_, \
{ .pointer = _val_ }, \
}
#define PROPERTY_ENTRY_U8_ARRAY_LEN(_name_, _val_, _len_) \
__PROPERTY_ENTRY_ARRAY_LEN(_name_, u8_data, U8, _val_, _len_)
#define PROPERTY_ENTRY_U16_ARRAY_LEN(_name_, _val_, _len_) \
__PROPERTY_ENTRY_ARRAY_LEN(_name_, u16_data, U16, _val_, _len_)
#define PROPERTY_ENTRY_U32_ARRAY_LEN(_name_, _val_, _len_) \
__PROPERTY_ENTRY_ARRAY_LEN(_name_, u32_data, U32, _val_, _len_)
#define PROPERTY_ENTRY_U64_ARRAY_LEN(_name_, _val_, _len_) \
__PROPERTY_ENTRY_ARRAY_LEN(_name_, u64_data, U64, _val_, _len_)
#define PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, _len_) \
__PROPERTY_ENTRY_ARRAY_LEN(_name_, str, STRING, _val_, _len_)
#define PROPERTY_ENTRY_REF_ARRAY_LEN(_name_, _val_, _len_) \
(struct property_entry) { \
.name = _name_, \
.length = (_len_) * sizeof(struct software_node_ref_args), \
.type = DEV_PROP_REF, \
{ .pointer = _val_ }, \
}
#define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_) \
PROPERTY_ENTRY_U8_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
#define PROPERTY_ENTRY_U16_ARRAY(_name_, _val_) \
PROPERTY_ENTRY_U16_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
#define PROPERTY_ENTRY_U32_ARRAY(_name_, _val_) \
PROPERTY_ENTRY_U32_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
#define PROPERTY_ENTRY_U64_ARRAY(_name_, _val_) \
PROPERTY_ENTRY_U64_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \
PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
#define PROPERTY_ENTRY_REF_ARRAY(_name_, _val_) \
PROPERTY_ENTRY_REF_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
Annotation
- Immediate include surface: `linux/args.h`, `linux/array_size.h`, `linux/bits.h`, `linux/cleanup.h`, `linux/fwnode.h`, `linux/stddef.h`, `linux/types.h`, `linux/util_macros.h`.
- Detected declarations: `struct device`, `struct software_node`, `struct software_node_ref_args`, `struct property_entry`, `struct software_node`, `enum dev_prop_type`, `function fwnode_device_is_big_endian`, `function fwnode_device_is_compatible`, `function device_is_big_endian`, `function device_is_compatible`.
- 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.