// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: dswstate - Dispatcher parse tree walk management routines * * Copyright (C) 2000 - 2023, Intel Corp. * *****************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acparser.h" #include "acdispat.h" #include "acnamesp.h" #define _COMPONENT … ACPI_MODULE_NAME("dswstate") /* Local prototypes */ static acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state); static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state); /******************************************************************************* * * FUNCTION: acpi_ds_result_pop * * PARAMETERS: object - Where to return the popped object * walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Pop an object off the top of this walk's result stack * ******************************************************************************/ acpi_status acpi_ds_result_pop(union acpi_operand_object **object, struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_result_push * * PARAMETERS: object - Where to return the popped object * walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Push an object onto the current result stack * ******************************************************************************/ acpi_status acpi_ds_result_push(union acpi_operand_object *object, struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_result_stack_push * * PARAMETERS: walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Push an object onto the walk_state result stack * ******************************************************************************/ static acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_result_stack_pop * * PARAMETERS: walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Pop an object off of the walk_state result stack * ******************************************************************************/ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_obj_stack_push * * PARAMETERS: object - Object to push * walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Push an object onto this walk's object/operand stack * ******************************************************************************/ acpi_status acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_obj_stack_pop * * PARAMETERS: pop_count - Number of objects/entries to pop * walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT * deleted by this routine. * ******************************************************************************/ acpi_status acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_obj_stack_pop_and_delete * * PARAMETERS: pop_count - Number of objects/entries to pop * walk_state - Current Walk state * * RETURN: Status * * DESCRIPTION: Pop this walk's object stack and delete each object that is * popped off. * ******************************************************************************/ void acpi_ds_obj_stack_pop_and_delete(u32 pop_count, struct acpi_walk_state *walk_state) { … } /******************************************************************************* * * FUNCTION: acpi_ds_get_current_walk_state * * PARAMETERS: thread - Get current active state for this Thread * * RETURN: Pointer to the current walk state * * DESCRIPTION: Get the walk state that is at the head of the list (the "current" * walk state.) * ******************************************************************************/ struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state *thread) { … } /******************************************************************************* * * FUNCTION: acpi_ds_push_walk_state * * PARAMETERS: walk_state - State to push * thread - Thread state object * * RETURN: None * * DESCRIPTION: Place the Thread state at the head of the state list * ******************************************************************************/ void acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, struct acpi_thread_state *thread) { … } /******************************************************************************* * * FUNCTION: acpi_ds_pop_walk_state * * PARAMETERS: thread - Current thread state * * RETURN: A walk_state object popped from the thread's stack * * DESCRIPTION: Remove and return the walkstate object that is at the head of * the walk stack for the given walk list. NULL indicates that * the list is empty. * ******************************************************************************/ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread) { … } /******************************************************************************* * * FUNCTION: acpi_ds_create_walk_state * * PARAMETERS: owner_id - ID for object creation * origin - Starting point for this walk * method_desc - Method object * thread - Current thread state * * RETURN: Pointer to the new walk state. * * DESCRIPTION: Allocate and initialize a new walk state. The current walk * state is set to this new state. * ******************************************************************************/ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union acpi_parse_object *origin, union acpi_operand_object *method_desc, struct acpi_thread_state *thread) { … } /******************************************************************************* * * FUNCTION: acpi_ds_init_aml_walk * * PARAMETERS: walk_state - New state to be initialized * op - Current parse op * method_node - Control method NS node, if any * aml_start - Start of AML * aml_length - Length of AML * info - Method info block (params, etc.) * pass_number - 1, 2, or 3 * * RETURN: Status * * DESCRIPTION: Initialize a walk state for a pass 1 or 2 parse tree walk * ******************************************************************************/ acpi_status acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state, union acpi_parse_object *op, struct acpi_namespace_node *method_node, u8 * aml_start, u32 aml_length, struct acpi_evaluate_info *info, u8 pass_number) { … } /******************************************************************************* * * FUNCTION: acpi_ds_delete_walk_state * * PARAMETERS: walk_state - State to delete * * RETURN: Status * * DESCRIPTION: Delete a walk state including all internal data structures * ******************************************************************************/ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state) { … }