drivers/acpi/property.c
Source file repositories/reference/linux-study-clean/drivers/acpi/property.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/property.c- Extension
.c- Size
- 47834 bytes
- Lines
- 1783
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/acpi.hlinux/device.hlinux/export.hinternal.h
Detected Declarations
function acpi_nondev_subnode_extractfunction acpi_nondev_subnode_okfunction acpi_add_nondev_subnodesfunction acpi_enumerate_nondev_subnodesfunction acpi_property_value_okfunction acpi_properties_format_validfunction acpi_init_of_compatiblefunction acpi_is_property_guidfunction acpi_data_add_propsfunction acpi_nondev_subnode_tagfunction list_for_each_entryfunction acpi_tie_nondev_subnodesfunction list_for_each_entryfunction acpi_data_add_buffer_propsfunction acpi_extract_propertiesfunction acpi_init_propertiesfunction acpi_free_device_propertiesfunction list_for_each_entry_safefunction acpi_destroy_nondev_subnodesfunction list_for_each_entry_safe_reversefunction acpi_free_propertiesfunction acpi_data_get_propertyfunction list_for_each_entryfunction acpi_dev_get_propertyfunction acpi_device_data_of_nodefunction acpi_node_prop_getfunction acpi_data_get_property_arrayfunction acpi_fwnode_get_named_child_nodefunction fwnode_for_each_child_nodefunction acpi_fwnode_get_args_countfunction acpi_get_ref_argsfunction acpi_fwnode_get_reference_argsfunction Packagefunction Packagefunction acpi_data_prop_read_singlefunction acpi_copy_property_array_stringfunction acpi_data_prop_readfunction acpi_node_prop_readfunction stop_on_nextfunction acpi_get_next_subnodefunction acpi_get_next_subnodefunction acpi_node_get_parentfunction is_acpi_graph_nodefunction fwnode_for_each_child_nodefunction acpi_graph_get_remote_endpointfunction acpi_fwnode_device_is_availablefunction acpi_fwnode_device_get_match_datafunction acpi_fwnode_device_dma_supported
Annotated Snippet
switch (link->package.elements[1].type) {
case ACPI_TYPE_STRING:
/*
* The string is expected to be a full pathname or a
* pathname segment relative to the given scope. That
* pathname is expected to point to an object returning
* a package that contains _DSD-equivalent information.
*/
result = acpi_nondev_subnode_ok(scope, link, list,
parent);
break;
case ACPI_TYPE_PACKAGE:
/*
* This happens when a reference is used in AML to
* point to the target. Since the target is expected
* to be a named object, a reference to it will cause it
* to be avaluated in place and its return package will
* be embedded in the links package at the location of
* the reference.
*
* The target package is expected to contain _DSD-
* equivalent information, but the scope in which it
* is located in the original AML is unknown. Thus
* it cannot contain pathname segments represented as
* strings because there is no way to build full
* pathnames out of them.
*/
acpi_handle_debug(scope, "subnode %s: Unknown scope\n",
link->package.elements[0].string.pointer);
desc = &link->package.elements[1];
result = acpi_nondev_subnode_extract(desc, NULL, link,
list, parent);
break;
case ACPI_TYPE_LOCAL_REFERENCE:
/*
* It is not expected to see any local references in
* the links package because referencing a named object
* should cause it to be evaluated in place.
*/
acpi_handle_info(scope, "subnode %s: Unexpected reference\n",
link->package.elements[0].string.pointer);
fallthrough;
default:
result = false;
break;
}
ret = ret || result;
}
return ret;
}
static bool acpi_enumerate_nondev_subnodes(acpi_handle scope,
union acpi_object *desc,
struct acpi_device_data *data,
struct fwnode_handle *parent)
{
int i;
/* Look for the ACPI data subnodes GUID. */
for (i = 0; i < desc->package.count; i += 2) {
const union acpi_object *guid;
union acpi_object *links;
guid = &desc->package.elements[i];
links = &desc->package.elements[i + 1];
/*
* The first element must be a GUID and the second one must be
* a package.
*/
if (guid->type != ACPI_TYPE_BUFFER ||
guid->buffer.length != 16 ||
links->type != ACPI_TYPE_PACKAGE)
break;
if (!guid_equal((guid_t *)guid->buffer.pointer, &ads_guid))
continue;
return acpi_add_nondev_subnodes(scope, links, &data->subnodes,
parent);
}
return false;
}
static bool acpi_property_value_ok(const union acpi_object *value)
{
int j;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/device.h`, `linux/export.h`, `internal.h`.
- Detected declarations: `function acpi_nondev_subnode_extract`, `function acpi_nondev_subnode_ok`, `function acpi_add_nondev_subnodes`, `function acpi_enumerate_nondev_subnodes`, `function acpi_property_value_ok`, `function acpi_properties_format_valid`, `function acpi_init_of_compatible`, `function acpi_is_property_guid`, `function acpi_data_add_props`, `function acpi_nondev_subnode_tag`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration 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.