drivers/acpi/acpica/excreate.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/excreate.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/excreate.c- Extension
.c- Size
- 13041 bytes
- Lines
- 471
- 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.hacinterp.hamlcode.hacnamesp.h
Detected Declarations
function Copyrightfunction acpi_ex_create_eventfunction Mutexfunction acpi_ex_create_regionfunction Processorfunction power_resourcefunction acpi_ex_create_method
Annotated Snippet
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/******************************************************************************
*
* Module Name: excreate - Named object creation
*
* Copyright (C) 2000 - 2026, Intel Corp.
*
*****************************************************************************/
#include <acpi/acpi.h>
#include "accommon.h"
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("excreate")
/*******************************************************************************
*
* FUNCTION: acpi_ex_create_alias
*
* PARAMETERS: walk_state - Current state, contains operands
*
* RETURN: Status
*
* DESCRIPTION: Create a new named alias
*
******************************************************************************/
acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
{
struct acpi_namespace_node *target_node;
struct acpi_namespace_node *alias_node;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(ex_create_alias);
/* Get the source/alias operands (both namespace nodes) */
alias_node = (struct acpi_namespace_node *)walk_state->operands[0];
target_node = (struct acpi_namespace_node *)walk_state->operands[1];
if ((target_node->type == ACPI_TYPE_LOCAL_ALIAS) ||
(target_node->type == ACPI_TYPE_LOCAL_METHOD_ALIAS)) {
/*
* Dereference an existing alias so that we don't create a chain
* of aliases. With this code, we guarantee that an alias is
* always exactly one level of indirection away from the
* actual aliased name.
*/
target_node =
ACPI_CAST_PTR(struct acpi_namespace_node,
target_node->object);
}
/* Ensure that the target node is valid */
if (!target_node) {
return_ACPI_STATUS(AE_NULL_OBJECT);
}
/* Construct the alias object (a namespace node) */
switch (target_node->type) {
case ACPI_TYPE_METHOD:
/*
* Control method aliases need to be differentiated with
* a special type
*/
alias_node->type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
break;
default:
/*
* All other object types.
*
* The new alias has the type ALIAS and points to the original
* NS node, not the object itself.
*/
alias_node->type = ACPI_TYPE_LOCAL_ALIAS;
alias_node->object =
ACPI_CAST_PTR(union acpi_operand_object, target_node);
break;
}
/* Since both operands are Nodes, we don't need to delete them */
alias_node->object =
ACPI_CAST_PTR(union acpi_operand_object, target_node);
return_ACPI_STATUS(status);
}
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acinterp.h`, `amlcode.h`, `acnamesp.h`.
- Detected declarations: `function Copyright`, `function acpi_ex_create_event`, `function Mutex`, `function acpi_ex_create_region`, `function Processor`, `function power_resource`, `function acpi_ex_create_method`.
- 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.