// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: psloop - Main AML parse loop * * Copyright (C) 2000 - 2023, Intel Corp. * *****************************************************************************/ /* * Parse the AML and build an operation tree as most interpreters, (such as * Perl) do. Parsing is done by hand rather than with a YACC generated parser * to tightly constrain stack and dynamic memory usage. Parsing is kept * flexible and the code fairly compact by parsing based on a list of AML * opcode templates in aml_op_info[]. */ #include <acpi/acpi.h> #include "accommon.h" #include "acinterp.h" #include "acparser.h" #include "acdispat.h" #include "amlcode.h" #include "acconvert.h" #include "acnamesp.h" #define _COMPONENT … ACPI_MODULE_NAME("psloop") /* Local prototypes */ static acpi_status acpi_ps_get_arguments(struct acpi_walk_state *walk_state, u8 * aml_op_start, union acpi_parse_object *op); /******************************************************************************* * * FUNCTION: acpi_ps_get_arguments * * PARAMETERS: walk_state - Current state * aml_op_start - Op start in AML * op - Current Op * * RETURN: Status * * DESCRIPTION: Get arguments for passed Op. * ******************************************************************************/ static acpi_status acpi_ps_get_arguments(struct acpi_walk_state *walk_state, u8 * aml_op_start, union acpi_parse_object *op) { … } /******************************************************************************* * * FUNCTION: acpi_ps_parse_loop * * PARAMETERS: walk_state - Current state * * RETURN: Status * * DESCRIPTION: Parse AML (pointed to by the current parser state) and return * a tree of ops. * ******************************************************************************/ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) { … }