drivers/acpi/acpica/psargs.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/psargs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/psargs.c- Extension
.c- Size
- 26515 bytes
- Lines
- 1068
- 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.hacparser.hamlcode.hacnamesp.hacdispat.hacconvert.h
Detected Declarations
function acpi_ps_get_next_package_lengthfunction acpi_ps_get_next_namepathfunction acpi_ps_get_next_simple_argfunction acpi_ps_free_field_listfunction acpi_ps_get_next_arg
Annotated Snippet
if (end == start) {
start = NULL;
}
end++;
break;
case AML_DUAL_NAME_PREFIX:
/* Two name segments */
end += 1 + (2 * ACPI_NAMESEG_SIZE);
break;
case AML_MULTI_NAME_PREFIX:
/* Multiple name segments, 4 chars each, count in next byte */
if ((end + 1) >= parser_state->aml_end) {
parser_state->aml = parser_state->aml_end;
return_PTR(NULL);
}
end += 2 + (*(end + 1) * ACPI_NAMESEG_SIZE);
break;
default:
/* Single name segment */
end += ACPI_NAMESEG_SIZE;
break;
}
if (end > parser_state->aml_end) {
parser_state->aml = parser_state->aml_end;
return_PTR(NULL);
}
parser_state->aml = end;
return_PTR((char *)start);
}
/*******************************************************************************
*
* FUNCTION: acpi_ps_get_next_namepath
*
* PARAMETERS: parser_state - Current parser state object
* arg - Where the namepath will be stored
* arg_count - If the namepath points to a control method
* the method's argument is returned here.
* possible_method_call - Whether the namepath can possibly be the
* start of a method call
*
* RETURN: Status
*
* DESCRIPTION: Get next name (if method call, return # of required args).
* Names are looked up in the internal namespace to determine
* if the name represents a control method. If a method
* is found, the number of arguments to the method is returned.
* This information is critical for parsing to continue correctly.
*
******************************************************************************/
acpi_status
acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
struct acpi_parse_state *parser_state,
union acpi_parse_object *arg, u8 possible_method_call)
{
acpi_status status;
char *path;
union acpi_parse_object *name_op;
union acpi_operand_object *method_desc;
struct acpi_namespace_node *node;
u8 *start = parser_state->aml;
ACPI_FUNCTION_TRACE(ps_get_next_namepath);
path = acpi_ps_get_next_namestring(parser_state);
acpi_ps_init_op(arg, AML_INT_NAMEPATH_OP);
/* Null path case is allowed, just exit */
if (!path) {
arg->common.value.name = path;
return_ACPI_STATUS(AE_OK);
}
/*
* Lookup the name in the internal namespace, starting with the current
* scope. We don't want to add anything new to the namespace here,
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `amlcode.h`, `acnamesp.h`, `acdispat.h`, `acconvert.h`.
- Detected declarations: `function acpi_ps_get_next_package_length`, `function acpi_ps_get_next_namepath`, `function acpi_ps_get_next_simple_arg`, `function acpi_ps_free_field_list`, `function acpi_ps_get_next_arg`.
- 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.