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: exdebug - Support for stores to the AML Debug Object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include "acinterp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define _COMPONENT          ACPI_EXECUTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) ACPI_MODULE_NAME("exdebug")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #ifndef ACPI_NO_ERROR_MESSAGES
^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)  * FUNCTION:    acpi_ex_do_debug_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * PARAMETERS:  source_desc         - Object to be output to "Debug Object"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *              level               - Indentation level (used for packages)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  *              index               - Current package element, zero if not pkg
^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: Handles stores to the AML Debug Object. For example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  *              Store(INT1, Debug)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * This function is not compiled if ACPI_NO_ERROR_MESSAGES is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * This function is only enabled if acpi_gbl_enable_aml_debug_object is set, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * if ACPI_LV_DEBUG_OBJECT is set in the acpi_dbg_level. Thus, in the normal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * operational case, stores to the debug object are ignored but can be easily
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * enabled if necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 			u32 level, u32 index)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	u32 timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	union acpi_operand_object *object_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	u32 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	/* Output must be enabled via the debug_object global or the dbg_level */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	if (!acpi_gbl_enable_aml_debug_object &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	    !(acpi_dbg_level & ACPI_LV_DEBUG_OBJECT)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	/* Newline -- don't emit the line header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	if (source_desc &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	    (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	    (source_desc->common.type == ACPI_TYPE_STRING)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		if ((source_desc->string.length == 1) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		    (*source_desc->string.pointer == '\n')) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 			acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	 * Print line header as long as we are not in the middle of an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	 * object display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	if (!((level > 0) && index == 0)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		if (acpi_gbl_display_debug_timer) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 			 * We will emit the current timer value (in microseconds) with each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			 * debug output. Only need the lower 26 bits. This allows for 67
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 			 * million microseconds or 67 seconds before rollover.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 			 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 			 * Convert 100 nanosecond units to microseconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 			timer = ((u32)acpi_os_get_timer() / 10);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			timer &= 0x03FFFFFF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			acpi_os_printf("ACPI Debug: T=0x%8.8X %*s", timer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 				       level, " ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 			acpi_os_printf("ACPI Debug: %*s", level, " ");
^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) 	/* Display the index for package output only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	if (index > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		acpi_os_printf("(%.2u) ", index - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	if (!source_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		acpi_os_printf("[Null Object]\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		/* No object type prefix needed for integers and strings */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		if ((source_desc->common.type != ACPI_TYPE_INTEGER) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		    (source_desc->common.type != ACPI_TYPE_STRING)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			acpi_os_printf("%s ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 				       acpi_ut_get_object_type_name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 				       (source_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		if (!acpi_ut_valid_internal_object(source_desc)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 			acpi_os_printf("%p, Invalid Internal Object!\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 				       source_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 			return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	} else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) ==
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		   ACPI_DESC_TYPE_NAMED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		acpi_os_printf("%s (Node %p)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 			       acpi_ut_get_type_name(((struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 						       acpi_namespace_node *)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 						      source_desc)->type),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 			       source_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	/* source_desc is of type ACPI_DESC_TYPE_OPERAND */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	switch (source_desc->common.type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	case ACPI_TYPE_INTEGER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		/* Output correct integer width */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		if (acpi_gbl_integer_byte_width == 4) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 			acpi_os_printf("0x%8.8X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 				       (u32)source_desc->integer.value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			acpi_os_printf("0x%8.8X%8.8X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 				       ACPI_FORMAT_UINT64(source_desc->integer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 							  value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		acpi_os_printf("[0x%.2X]\n", (u32)source_desc->buffer.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		acpi_ut_dump_buffer(source_desc->buffer.pointer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 				    (source_desc->buffer.length < 256) ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 				    source_desc->buffer.length : 256,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 				    DB_BYTE_DISPLAY, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		acpi_os_printf("\"%s\"\n", source_desc->string.pointer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	case ACPI_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		acpi_os_printf("(Contains 0x%.2X Elements):\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 			       source_desc->package.count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		/* Output the entire contents of the package */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		for (i = 0; i < source_desc->package.count; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 			acpi_ex_do_debug_object(source_desc->package.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 						elements[i], level + 4, i + 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	case ACPI_TYPE_LOCAL_REFERENCE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		acpi_os_printf("[%s] ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 			       acpi_ut_get_reference_name(source_desc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		/* Decode the reference */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		switch (source_desc->reference.class) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		case ACPI_REFCLASS_INDEX:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 			acpi_os_printf("0x%X\n", source_desc->reference.value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		case ACPI_REFCLASS_TABLE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 			/* Case for ddb_handle */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 			acpi_os_printf("Table Index 0x%X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 				       source_desc->reference.value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 			return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		acpi_os_printf(" ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		/* Check for valid node first, then valid object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		if (source_desc->reference.node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 			if (ACPI_GET_DESCRIPTOR_TYPE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 			    (source_desc->reference.node) !=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 			    ACPI_DESC_TYPE_NAMED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 				acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 				    (" %p - Not a valid namespace node\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 				     source_desc->reference.node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 				acpi_os_printf("Node %p [%4.4s] ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 					       source_desc->reference.node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 					       (source_desc->reference.node)->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 					       name.ascii);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 				switch ((source_desc->reference.node)->type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 					/* These types have no attached object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 				case ACPI_TYPE_DEVICE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 					acpi_os_printf("Device\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 				case ACPI_TYPE_THERMAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 					acpi_os_printf("Thermal Zone\n");
^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) 				default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 					acpi_ex_do_debug_object((source_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 								 reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 								 node)->object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 								level + 4, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 		} else if (source_desc->reference.object) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 			if (ACPI_GET_DESCRIPTOR_TYPE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 			    (source_desc->reference.object) ==
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 			    ACPI_DESC_TYPE_NAMED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 				/* Reference object is a namespace node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 				acpi_ex_do_debug_object(ACPI_CAST_PTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 							(union
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 							 acpi_operand_object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 							 source_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 							 object), level + 4, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 				object_desc = source_desc->reference.object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 				value = source_desc->reference.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 				switch (object_desc->common.type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 				case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 					acpi_os_printf("Buffer[%u] = 0x%2.2X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 						       value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 						       *source_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 						       index_pointer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 				case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 					acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 					    ("String[%u] = \"%c\" (0x%2.2X)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 					     value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 					     *source_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 					     index_pointer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 					     *source_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 					     index_pointer);
^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_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 					acpi_os_printf("Package[%u] = ", value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 					if (!(*source_desc->reference.where)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 						acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 						    ("[Uninitialized Package Element]\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 					} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 						acpi_ex_do_debug_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 						    (*source_desc->reference.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 						     where, level + 4, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 					}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 				default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 					acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 					    ("Unknown Reference object type %X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 					     object_desc->common.type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 		acpi_os_printf("(Descriptor %p)\n", source_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC, "\n"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) #endif