drivers/acpi/acpica/nsrepair2.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/nsrepair2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/nsrepair2.c- Extension
.c- Size
- 29527 bytes
- Lines
- 952
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hacnamesp.h
Detected Declarations
function acpi_ns_complex_repairsfunction acpi_ns_repair_ALRfunction acpi_ns_repair_FDEfunction acpi_ns_repair_CIDfunction acpi_ns_repair_CSTfunction acpi_ns_repair_HIDfunction acpi_ns_repair_PRTfunction frequencyfunction acpi_ns_repair_TSSfunction acpi_ns_check_sorted_listfunction acpi_ns_sort_listfunction acpi_ns_remove_element
Annotated Snippet
if (ACPI_COMPARE_NAMESEG(node->name.ascii, this_name->name)) {
return (this_name);
}
this_name++;
}
return (NULL); /* Not found */
}
/******************************************************************************
*
* FUNCTION: acpi_ns_repair_ALR
*
* PARAMETERS: info - Method execution information block
* return_object_ptr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _ALR object. If necessary, sort the object list
* ascending by the ambient illuminance values.
*
*****************************************************************************/
static acpi_status
acpi_ns_repair_ALR(struct acpi_evaluate_info *info,
union acpi_operand_object **return_object_ptr)
{
union acpi_operand_object *return_object = *return_object_ptr;
acpi_status status;
status = acpi_ns_check_sorted_list(info, return_object, 0, 2, 1,
ACPI_SORT_ASCENDING,
"AmbientIlluminance");
return (status);
}
/******************************************************************************
*
* FUNCTION: acpi_ns_repair_FDE
*
* PARAMETERS: info - Method execution information block
* return_object_ptr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _FDE and _GTM objects. The expected return
* value is a Buffer of 5 DWORDs. This function repairs a common
* problem where the return value is a Buffer of BYTEs, not
* DWORDs.
*
*****************************************************************************/
static acpi_status
acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
union acpi_operand_object **return_object_ptr)
{
union acpi_operand_object *return_object = *return_object_ptr;
union acpi_operand_object *buffer_object;
u8 *byte_buffer;
u32 *dword_buffer;
u32 i;
ACPI_FUNCTION_NAME(ns_repair_FDE);
switch (return_object->common.type) {
case ACPI_TYPE_BUFFER:
/* This is the expected type. Length should be (at least) 5 DWORDs */
if (return_object->buffer.length >= ACPI_FDE_DWORD_BUFFER_SIZE) {
return (AE_OK);
}
/* We can only repair if we have exactly 5 BYTEs */
if (return_object->buffer.length != ACPI_FDE_BYTE_BUFFER_SIZE) {
ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
info->node_flags,
"Incorrect return buffer length %u, expected %u",
return_object->buffer.length,
ACPI_FDE_DWORD_BUFFER_SIZE));
return (AE_AML_OPERAND_TYPE);
}
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acnamesp.h`.
- Detected declarations: `function acpi_ns_complex_repairs`, `function acpi_ns_repair_ALR`, `function acpi_ns_repair_FDE`, `function acpi_ns_repair_CID`, `function acpi_ns_repair_CST`, `function acpi_ns_repair_HID`, `function acpi_ns_repair_PRT`, `function frequency`, `function acpi_ns_repair_TSS`, `function acpi_ns_check_sorted_list`.
- Atlas domain: Driver Families / drivers/acpi.
- 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.