Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Module Name: dbobject - ACPI object decode and display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "acdebug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #define _COMPONENT          ACPI_CA_DEBUGGER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) ACPI_MODULE_NAME("dbobject")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) /* Local prototypes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) static void acpi_db_decode_node(struct acpi_namespace_node *node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * FUNCTION:    acpi_db_dump_method_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * PARAMETERS:  status          - Method execution status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  *              walk_state      - Current state of the parse tree walk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * DESCRIPTION: Called when a method has been aborted because of an error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  *              Dumps the method execution stack, and the method locals/args,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  *              and disassembles the AML opcode that failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) acpi_db_dump_method_info(acpi_status status, struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	struct acpi_thread_state *thread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	struct acpi_namespace_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	node = walk_state->method_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	/* There are no locals or arguments for the module-level code case */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	if (node == acpi_gbl_root_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	/* Ignore control codes, they are not errors */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	if ((status & AE_CODE_MASK) == AE_CODE_CONTROL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	/* We may be executing a deferred opcode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	if (walk_state->deferred_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		acpi_os_printf("Executing subtree for Buffer/Package/Region\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	 * If there is no Thread, we are not actually executing a method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	 * This can happen when the iASL compiler calls the interpreter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	 * to perform constant folding.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	thread = walk_state->thread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	if (!thread) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	/* Display the method locals and arguments */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	acpi_db_decode_locals(walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	acpi_db_decode_arguments(walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  * FUNCTION:    acpi_db_decode_internal_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  * PARAMETERS:  obj_desc        - Object to be displayed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  * DESCRIPTION: Short display of an internal object. Numbers/Strings/Buffers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) void acpi_db_decode_internal_object(union acpi_operand_object *obj_desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		acpi_os_printf(" Uninitialized");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		acpi_os_printf(" %p [%s]", obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 			       acpi_ut_get_descriptor_name(obj_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	acpi_os_printf(" %s", acpi_ut_get_object_type_name(obj_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	switch (obj_desc->common.type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	case ACPI_TYPE_INTEGER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		acpi_os_printf(" %8.8X%8.8X",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 			       ACPI_FORMAT_UINT64(obj_desc->integer.value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		acpi_os_printf("(%u) \"%.60s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 			       obj_desc->string.length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			       obj_desc->string.pointer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		if (obj_desc->string.length > 60) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 			acpi_os_printf("...");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 			acpi_os_printf("\"");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		acpi_os_printf("(%u)", obj_desc->buffer.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		for (i = 0; (i < 8) && (i < obj_desc->buffer.length); i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			acpi_os_printf(" %2.2X", obj_desc->buffer.pointer[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		acpi_os_printf(" %p", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * FUNCTION:    acpi_db_decode_node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * PARAMETERS:  node        - Object to be displayed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  * DESCRIPTION: Short display of a namespace node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) static void acpi_db_decode_node(struct acpi_namespace_node *node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	acpi_os_printf("<Node>          Name %4.4s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		       acpi_ut_get_node_name(node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	if (node->flags & ANOBJ_METHOD_ARG) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		acpi_os_printf(" [Method Arg]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	if (node->flags & ANOBJ_METHOD_LOCAL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		acpi_os_printf(" [Method Local]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	switch (node->type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		/* These types have no attached object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	case ACPI_TYPE_DEVICE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		acpi_os_printf(" Device");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	case ACPI_TYPE_THERMAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		acpi_os_printf(" Thermal Zone");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		acpi_db_decode_internal_object(acpi_ns_get_attached_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 					       (node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)  * FUNCTION:    acpi_db_display_internal_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  * PARAMETERS:  obj_desc        - Object to be displayed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  *              walk_state      - Current walk state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)  * DESCRIPTION: Short display of an internal object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) acpi_db_display_internal_object(union acpi_operand_object *obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 				struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	u8 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	acpi_os_printf("%p ", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		acpi_os_printf("<Null Object>\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	/* Decode the object type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	case ACPI_DESC_TYPE_PARSER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		acpi_os_printf("<Parser> ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	case ACPI_DESC_TYPE_NAMED:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		acpi_db_decode_node((struct acpi_namespace_node *)obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	case ACPI_DESC_TYPE_OPERAND:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 		type = obj_desc->common.type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		if (type > ACPI_TYPE_LOCAL_MAX) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 			acpi_os_printf(" Type %X [Invalid Type]", (u32)type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 		/* Decode the ACPI object type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 		switch (obj_desc->common.type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		case ACPI_TYPE_LOCAL_REFERENCE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 			acpi_os_printf("[%s] ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 				       acpi_ut_get_reference_name(obj_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 			/* Decode the reference */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 			switch (obj_desc->reference.class) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 			case ACPI_REFCLASS_LOCAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 				acpi_os_printf("%X ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 					       obj_desc->reference.value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 				if (walk_state) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 					obj_desc = walk_state->local_variables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 					    [obj_desc->reference.value].object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 					acpi_os_printf("%p", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 					acpi_db_decode_internal_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 					    (obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 			case ACPI_REFCLASS_ARG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 				acpi_os_printf("%X ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 					       obj_desc->reference.value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 				if (walk_state) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 					obj_desc = walk_state->arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 					    [obj_desc->reference.value].object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 					acpi_os_printf("%p", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 					acpi_db_decode_internal_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 					    (obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 			case ACPI_REFCLASS_INDEX:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 				switch (obj_desc->reference.target_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 				case ACPI_TYPE_BUFFER_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 					acpi_os_printf("%p",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 						       obj_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 						       object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 					acpi_db_decode_internal_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 					    (obj_desc->reference.object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 				case ACPI_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 					acpi_os_printf("%p",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 						       obj_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 						       where);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 					if (!obj_desc->reference.where) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 						acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 						    (" Uninitialized WHERE pointer");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 					} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 						acpi_db_decode_internal_object(*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 									       (obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 										reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 										where));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 					}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 				default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 					acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 					    ("Unknown index target type");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 			case ACPI_REFCLASS_REFOF:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 				if (!obj_desc->reference.object) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 					acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 					    ("Uninitialized reference subobject pointer");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 				/* Reference can be to a Node or an Operand object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 				switch (ACPI_GET_DESCRIPTOR_TYPE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 					(obj_desc->reference.object)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 				case ACPI_DESC_TYPE_NAMED:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 					acpi_db_decode_node(obj_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 							    object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 				case ACPI_DESC_TYPE_OPERAND:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 					acpi_db_decode_internal_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 					    (obj_desc->reference.object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 				default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 			case ACPI_REFCLASS_NAME:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 				acpi_db_decode_node(obj_desc->reference.node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 			case ACPI_REFCLASS_DEBUG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 			case ACPI_REFCLASS_TABLE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 				acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 			default:	/* Unknown reference class */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 				acpi_os_printf("%2.2X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 					       obj_desc->reference.class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 			acpi_os_printf("<Obj>          ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 			acpi_db_decode_internal_object(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 		acpi_os_printf("<Not a valid ACPI Object Descriptor> [%s]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 			       acpi_ut_get_descriptor_name(obj_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)  * FUNCTION:    acpi_db_decode_locals
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)  * PARAMETERS:  walk_state      - State for current method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385)  * DESCRIPTION: Display all locals for the currently running control method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) void acpi_db_decode_locals(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 	struct acpi_namespace_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	u8 display_locals = FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	node = walk_state->method_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	/* There are no locals for the module-level code case */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	if (node == acpi_gbl_root_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	if (!node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 		    ("No method node (Executing subtree for buffer or opregion)\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	if (node->type != ACPI_TYPE_METHOD) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 		acpi_os_printf("Executing subtree for Buffer/Package/Region\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	/* Are any locals actually set? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 		obj_desc = walk_state->local_variables[i].object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 		if (obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 			display_locals = TRUE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	/* If any are set, only display the ones that are set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 	if (display_locals) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 		    ("\nInitialized Local Variables for Method [%4.4s]:\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 		     acpi_ut_get_node_name(node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 		for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 			obj_desc = walk_state->local_variables[i].object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 			if (obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 				acpi_os_printf("  Local%X: ", i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 				acpi_db_display_internal_object(obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 								walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 		    ("No Local Variables are initialized for Method [%4.4s]\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 		     acpi_ut_get_node_name(node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449)  * FUNCTION:    acpi_db_decode_arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451)  * PARAMETERS:  walk_state      - State for current method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)  * DESCRIPTION: Display all arguments for the currently running control method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) void acpi_db_decode_arguments(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 	struct acpi_namespace_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 	u8 display_args = FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 	node = walk_state->method_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	/* There are no arguments for the module-level code case */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 	if (node == acpi_gbl_root_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 	if (!node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 		    ("No method node (Executing subtree for buffer or opregion)\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	if (node->type != ACPI_TYPE_METHOD) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 		acpi_os_printf("Executing subtree for Buffer/Package/Region\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 	/* Are any arguments actually set? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 	for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 		obj_desc = walk_state->arguments[i].object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 		if (obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 			display_args = TRUE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 	/* If any are set, only display the ones that are set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 	if (display_args) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 		acpi_os_printf("Initialized Arguments for Method [%4.4s]:  "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 			       "(%X arguments defined for method invocation)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 			       acpi_ut_get_node_name(node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 			       node->object->method.param_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 		for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 			obj_desc = walk_state->arguments[i].object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 			if (obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 				acpi_os_printf("  Arg%u:   ", i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 				acpi_db_display_internal_object(obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 								walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 		    ("No Arguments are initialized for method [%4.4s]\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 		     acpi_ut_get_node_name(node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) }