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.

Dependency Surface

Detected Declarations

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

Implementation Notes