drivers/acpi/acpica/psopinfo.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/psopinfo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/psopinfo.c- Extension
.c- Size
- 7547 bytes
- Lines
- 234
- 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.hacopcode.hamlcode.hasldefine.h
Detected Declarations
function acpi_ps_get_argument_count
Annotated Snippet
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/******************************************************************************
*
* Module Name: psopinfo - AML opcode information functions and dispatch tables
*
* Copyright (C) 2000 - 2026, Intel Corp.
*
*****************************************************************************/
#include <acpi/acpi.h>
#include "accommon.h"
#include "acparser.h"
#include "acopcode.h"
#include "amlcode.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME("psopinfo")
static const u8 acpi_gbl_argument_count[] =
{ 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 };
/*******************************************************************************
*
* FUNCTION: acpi_ps_get_opcode_info
*
* PARAMETERS: opcode - The AML opcode
*
* RETURN: A pointer to the info about the opcode.
*
* DESCRIPTION: Find AML opcode description based on the opcode.
* NOTE: This procedure must ALWAYS return a valid pointer!
*
******************************************************************************/
const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
{
#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
const char *opcode_name = "Unknown AML opcode";
#endif
ACPI_FUNCTION_NAME(ps_get_opcode_info);
/*
* Detect normal 8-bit opcode or extended 16-bit opcode
*/
if (!(opcode & 0xFF00)) {
/* Simple (8-bit) opcode: 0-255, can't index beyond table */
return (&acpi_gbl_aml_op_info
[acpi_gbl_short_op_index[(u8)opcode]]);
}
if (((opcode & 0xFF00) == AML_EXTENDED_OPCODE) &&
(((u8)opcode) <= MAX_EXTENDED_OPCODE)) {
/* Valid extended (16-bit) opcode */
return (&acpi_gbl_aml_op_info
[acpi_gbl_long_op_index[(u8)opcode]]);
}
#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
#include "asldefine.h"
switch (opcode) {
case AML_RAW_DATA_BYTE:
opcode_name = "-Raw Data Byte-";
break;
case AML_RAW_DATA_WORD:
opcode_name = "-Raw Data Word-";
break;
case AML_RAW_DATA_DWORD:
opcode_name = "-Raw Data Dword-";
break;
case AML_RAW_DATA_QWORD:
opcode_name = "-Raw Data Qword-";
break;
case AML_RAW_DATA_BUFFER:
opcode_name = "-Raw Data Buffer-";
break;
case AML_RAW_DATA_CHAIN:
opcode_name = "-Raw Data Buffer Chain-";
break;
case AML_PACKAGE_LENGTH:
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acparser.h`, `acopcode.h`, `amlcode.h`, `asldefine.h`.
- Detected declarations: `function acpi_ps_get_argument_count`.
- 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.