linux/drivers/acpi/acpica/dbexec.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/*******************************************************************************
 *
 * Module Name: dbexec - debugger control method execution
 *
 ******************************************************************************/

#include <acpi/acpi.h>
#include "accommon.h"
#include "acdebug.h"
#include "acnamesp.h"

#define _COMPONENT
ACPI_MODULE_NAME("dbexec")

static struct acpi_db_method_info acpi_gbl_db_method_info;

/* Local prototypes */

static acpi_status
acpi_db_execute_method(struct acpi_db_method_info *info,
		       struct acpi_buffer *return_obj);

static acpi_status acpi_db_execute_setup(struct acpi_db_method_info *info);

static u32 acpi_db_get_outstanding_allocations(void);

static void ACPI_SYSTEM_XFACE acpi_db_method_thread(void *context);

static acpi_status
acpi_db_execution_walk(acpi_handle obj_handle,
		       u32 nesting_level, void *context, void **return_value);

static void ACPI_SYSTEM_XFACE acpi_db_single_execution_thread(void *context);

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_delete_objects
 *
 * PARAMETERS:  count               - Count of objects in the list
 *              objects             - Array of ACPI_OBJECTs to be deleted
 *
 * RETURN:      None
 *
 * DESCRIPTION: Delete a list of ACPI_OBJECTS. Handles packages and nested
 *              packages via recursion.
 *
 ******************************************************************************/

void acpi_db_delete_objects(u32 count, union acpi_object *objects)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_execute_method
 *
 * PARAMETERS:  info            - Valid info segment
 *              return_obj      - Where to put return object
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Execute a control method. Used to evaluate objects via the
 *              "EXECUTE" or "EVALUATE" commands.
 *
 ******************************************************************************/

static acpi_status
acpi_db_execute_method(struct acpi_db_method_info *info,
		       struct acpi_buffer *return_obj)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_execute_setup
 *
 * PARAMETERS:  info            - Valid method info
 *
 * RETURN:      None
 *
 * DESCRIPTION: Setup info segment prior to method execution
 *
 ******************************************************************************/

static acpi_status acpi_db_execute_setup(struct acpi_db_method_info *info)
{}

#ifdef ACPI_DBG_TRACK_ALLOCATIONS
u32 acpi_db_get_cache_info(struct acpi_memory_list *cache)
{

	return (cache->total_allocated - cache->total_freed -
		cache->current_depth);
}
#endif

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_get_outstanding_allocations
 *
 * PARAMETERS:  None
 *
 * RETURN:      Current global allocation count minus cache entries
 *
 * DESCRIPTION: Determine the current number of "outstanding" allocations --
 *              those allocations that have not been freed and also are not
 *              in one of the various object caches.
 *
 ******************************************************************************/

static u32 acpi_db_get_outstanding_allocations(void)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_execution_walk
 *
 * PARAMETERS:  WALK_CALLBACK
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Execute a control method. Name is relative to the current
 *              scope.
 *
 ******************************************************************************/

static acpi_status
acpi_db_execution_walk(acpi_handle obj_handle,
		       u32 nesting_level, void *context, void **return_value)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_execute
 *
 * PARAMETERS:  name                - Name of method to execute
 *              args                - Parameters to the method
 *              Types               -
 *              flags               - single step/no single step
 *
 * RETURN:      None
 *
 * DESCRIPTION: Execute a control method. Name is relative to the current
 *              scope. Function used for the "EXECUTE", "EVALUATE", and
 *              "ALL" commands
 *
 ******************************************************************************/

void
acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_method_thread
 *
 * PARAMETERS:  context             - Execution info segment
 *
 * RETURN:      None
 *
 * DESCRIPTION: Debugger execute thread. Waits for a command line, then
 *              simply dispatches it.
 *
 ******************************************************************************/

static void ACPI_SYSTEM_XFACE acpi_db_method_thread(void *context)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_single_execution_thread
 *
 * PARAMETERS:  context                 - Method info struct
 *
 * RETURN:      None
 *
 * DESCRIPTION: Create one thread and execute a method
 *
 ******************************************************************************/

static void ACPI_SYSTEM_XFACE acpi_db_single_execution_thread(void *context)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_create_execution_thread
 *
 * PARAMETERS:  method_name_arg         - Control method to execute
 *              arguments               - Array of arguments to the method
 *              types                   - Corresponding array of object types
 *
 * RETURN:      None
 *
 * DESCRIPTION: Create a single thread to evaluate a namespace object. Handles
 *              arguments passed on command line for control methods.
 *
 ******************************************************************************/

void
acpi_db_create_execution_thread(char *method_name_arg,
				char **arguments, acpi_object_type *types)
{}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_create_execution_threads
 *
 * PARAMETERS:  num_threads_arg         - Number of threads to create
 *              num_loops_arg           - Loop count for the thread(s)
 *              method_name_arg         - Control method to execute
 *
 * RETURN:      None
 *
 * DESCRIPTION: Create threads to execute method(s)
 *
 ******************************************************************************/

void
acpi_db_create_execution_threads(char *num_threads_arg,
				 char *num_loops_arg, char *method_name_arg)
{}