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: nsdump - table dumping routines for debug
^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 "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <acpi/acoutput.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #define _COMPONENT          ACPI_NAMESPACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) ACPI_MODULE_NAME("nsdump")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) /* Local prototypes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #ifdef ACPI_OBSOLETE_FUNCTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) void acpi_ns_dump_root_devices(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) acpi_ns_dump_one_device(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 			u32 level, void *context, void **return_value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) acpi_ns_dump_one_object_path(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 			     u32 level, void *context, void **return_value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) acpi_ns_get_max_depth(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		      u32 level, void *context, void **return_value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^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)  * FUNCTION:    acpi_ns_print_pathname
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * PARAMETERS:  num_segments        - Number of ACPI name segments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  *              pathname            - The compressed (internal) path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * DESCRIPTION: Print an object's full namespace pathname
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) void acpi_ns_print_pathname(u32 num_segments, const char *pathname)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	ACPI_FUNCTION_NAME(ns_print_pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	/* Check if debug output enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_NAMES, ACPI_NAMESPACE)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		return;
^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) 	/* Print the entire name */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "["));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	while (num_segments) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		for (i = 0; i < 4; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			isprint((int)pathname[i]) ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 			    acpi_os_printf("%c", pathname[i]) :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 			    acpi_os_printf("?");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		pathname += ACPI_NAMESEG_SIZE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		num_segments--;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		if (num_segments) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 			acpi_os_printf(".");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		}
^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) 	acpi_os_printf("]\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #ifdef ACPI_OBSOLETE_FUNCTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) /* Not used at this time, perhaps later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  * FUNCTION:    acpi_ns_dump_pathname
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  * PARAMETERS:  handle              - Object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)  *              msg                 - Prefix message
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  *              level               - Desired debug level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  *              component           - Caller's component ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  * DESCRIPTION: Print an object's full namespace pathname
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  *              Manages allocation/freeing of a pathname buffer
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) acpi_ns_dump_pathname(acpi_handle handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		      const char *msg, u32 level, u32 component)
^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_FUNCTION_TRACE(ns_dump_pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	/* Do this only if the requested debug level and component are enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	if (!ACPI_IS_DEBUG_ENABLED(level, component)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	/* Convert handle to a full pathname and print it (with supplied message) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	acpi_ns_print_node_pathname(handle, msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)  * FUNCTION:    acpi_ns_dump_one_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  * PARAMETERS:  obj_handle          - Node to be dumped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  *              level               - Nesting level of the handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  *              context             - Passed into walk_namespace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  *              return_value        - Not used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  * DESCRIPTION: Dump a single Node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  *              This procedure is a user_function called by acpi_ns_walk_namespace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) acpi_ns_dump_one_object(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 			u32 level, void *context, void **return_value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	struct acpi_walk_info *info = (struct acpi_walk_info *)context;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	struct acpi_namespace_node *this_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	union acpi_operand_object *obj_desc = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	acpi_object_type obj_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	acpi_object_type type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	u32 bytes_to_dump;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	u32 dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	ACPI_FUNCTION_NAME(ns_dump_one_object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	/* Is output enabled? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	if (!(acpi_dbg_level & info->debug_level)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	if (!obj_handle) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Null object handle\n"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	this_node = acpi_ns_validate_handle(obj_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	if (!this_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid object handle %p\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 				  obj_handle));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	type = this_node->type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	info->count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	/* Check if the owner matches */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	    (info->owner_id != this_node->owner_id)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	if (!(info->display_type & ACPI_DISPLAY_SHORT)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		/* Indent the object according to the level */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		/* Check the node type and name */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		if (type > ACPI_TYPE_LOCAL_MAX) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 			ACPI_WARNING((AE_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 				      "Invalid ACPI Object Type 0x%08X", type));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	/* Now we can print out the pertinent information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	acpi_os_printf(" %-12s %p %3.3X ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		       acpi_ut_get_type_name(type), this_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		       this_node->owner_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	dbg_level = acpi_dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	acpi_dbg_level = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	obj_desc = acpi_ns_get_attached_object(this_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	acpi_dbg_level = dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	/* Temp nodes are those nodes created by a control method */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	if (this_node->flags & ANOBJ_TEMPORARY) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		acpi_os_printf("(T) ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	switch (info->display_type & ACPI_DISPLAY_MASK) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	case ACPI_DISPLAY_SUMMARY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 			/* No attached object. Some types should always have an object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 			switch (type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 			case ACPI_TYPE_INTEGER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			case ACPI_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 			case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 			case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 			case ACPI_TYPE_METHOD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 				acpi_os_printf("<No attached object>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 			default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 			acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 			return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		switch (type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		case ACPI_TYPE_PROCESSOR:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 			acpi_os_printf("ID %02X Len %02X Addr %8.8X%8.8X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 				       obj_desc->processor.proc_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 				       obj_desc->processor.length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 				       ACPI_FORMAT_UINT64(obj_desc->processor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 							  address));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 		case ACPI_TYPE_DEVICE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 			acpi_os_printf("Notify Object: %p\n", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 		case ACPI_TYPE_METHOD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 			acpi_os_printf("Args %X Len %.4X Aml %p\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 				       (u32) obj_desc->method.param_count,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 				       obj_desc->method.aml_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 				       obj_desc->method.aml_start);
^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_INTEGER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 			acpi_os_printf("= %8.8X%8.8X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 				       ACPI_FORMAT_UINT64(obj_desc->integer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 							  value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 		case ACPI_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 			if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 				acpi_os_printf("Elements %.2X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 					       obj_desc->package.count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 				acpi_os_printf("[Length not yet evaluated]\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 		case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 			if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 				acpi_os_printf("Len %.2X",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 					       obj_desc->buffer.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 				/* Dump some of the buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 				if (obj_desc->buffer.length > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 					acpi_os_printf(" =");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 					for (i = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 					     (i < obj_desc->buffer.length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 					      && i < 12); i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 						acpi_os_printf(" %2.2X",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 							       obj_desc->buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 							       pointer[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 					}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 				acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 				acpi_os_printf("[Length not yet evaluated]\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 		case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 			acpi_os_printf("Len %.2X ", obj_desc->string.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 			acpi_ut_print_string(obj_desc->string.pointer, 80);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 			acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 		case ACPI_TYPE_REGION:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 			acpi_os_printf("[%s]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 				       acpi_ut_get_region_name(obj_desc->region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 							       space_id));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 			if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 				acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 					       ACPI_FORMAT_UINT64(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 								  region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 								  address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 					       obj_desc->region.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 				acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 				    (" [Address/Length not yet evaluated]\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 			}
^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_TYPE_LOCAL_REFERENCE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 			acpi_os_printf("[%s]\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 				       acpi_ut_get_reference_name(obj_desc));
^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) 		case ACPI_TYPE_BUFFER_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 			if (obj_desc->buffer_field.buffer_obj &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 			    obj_desc->buffer_field.buffer_obj->buffer.node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 				acpi_os_printf("Buf [%4.4s]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 					       acpi_ut_get_node_name(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 								     buffer_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 								     buffer_obj->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 								     buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 								     node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 		case ACPI_TYPE_LOCAL_REGION_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 			acpi_os_printf("Rgn [%4.4s]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 				       acpi_ut_get_node_name(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 							     common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 							     region_obj->region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 							     node));
^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) 		case ACPI_TYPE_LOCAL_BANK_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 			acpi_os_printf("Rgn [%4.4s] Bnk [%4.4s]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 				       acpi_ut_get_node_name(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 							     common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 							     region_obj->region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 							     node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 				       acpi_ut_get_node_name(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 							     bank_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 							     bank_obj->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 							     common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 							     node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 			acpi_os_printf("Idx [%4.4s] Dat [%4.4s]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 				       acpi_ut_get_node_name(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 							     index_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 							     index_obj->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 							     common_field.node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 				       acpi_ut_get_node_name(obj_desc->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 							     index_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 							     data_obj->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 							     common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 							     node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 		case ACPI_TYPE_LOCAL_ALIAS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 		case ACPI_TYPE_LOCAL_METHOD_ALIAS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 			acpi_os_printf("Target %4.4s (%p)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 				       acpi_ut_get_node_name(obj_desc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 				       obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 			acpi_os_printf("Object %p\n", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 		/* Common field handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		switch (type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 		case ACPI_TYPE_BUFFER_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 		case ACPI_TYPE_LOCAL_REGION_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 		case ACPI_TYPE_LOCAL_BANK_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 			acpi_os_printf(" Off %.3X Len %.2X Acc %.2X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 				       (obj_desc->common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 					base_byte_offset * 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 				       +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 				       obj_desc->common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 				       start_field_bit_offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 				       obj_desc->common_field.bit_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 				       obj_desc->common_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 				       access_byte_width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	case ACPI_DISPLAY_OBJECTS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 		acpi_os_printf("O:%p", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 		if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 			/* No attached object, we are done */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 			acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 			return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 		acpi_os_printf("(R%u)", obj_desc->common.reference_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 		switch (type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 		case ACPI_TYPE_METHOD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 			/* Name is a Method and its AML offset/length are set */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 			acpi_os_printf(" M:%p-%X\n", obj_desc->method.aml_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 				       obj_desc->method.aml_length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 		case ACPI_TYPE_INTEGER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 			acpi_os_printf(" I:%8.8X8.8%X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 				       ACPI_FORMAT_UINT64(obj_desc->integer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 							  value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 		case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 			acpi_os_printf(" S:%p-%X\n", obj_desc->string.pointer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 				       obj_desc->string.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 		case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 			acpi_os_printf(" B:%p-%X\n", obj_desc->buffer.pointer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 				       obj_desc->buffer.length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 			acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 		acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	/* If debug turned off, done */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	if (!(acpi_dbg_level & ACPI_LV_VALUES)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 	/* If there is an attached object, display it */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 	dbg_level = acpi_dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 	acpi_dbg_level = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 	obj_desc = acpi_ns_get_attached_object(this_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 	acpi_dbg_level = dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 	/* Dump attached objects */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 	while (obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 		obj_type = ACPI_TYPE_INVALID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 		acpi_os_printf("Attached Object %p: ", obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 		/* Decode the type of attached object and dump the contents */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 		switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 		case ACPI_DESC_TYPE_NAMED:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 			acpi_os_printf("(Ptr to Node)\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 			bytes_to_dump = sizeof(struct acpi_namespace_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 			ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 		case ACPI_DESC_TYPE_OPERAND:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 			obj_type = obj_desc->common.type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 			if (obj_type > ACPI_TYPE_LOCAL_MAX) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 				acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 				    ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 				     obj_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 				bytes_to_dump = 32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 				acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 				    ("(Pointer to ACPI Object type %.2X [%s])\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 				     obj_type, acpi_ut_get_type_name(obj_type));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) 				bytes_to_dump =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 				    sizeof(union acpi_operand_object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) 			ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) 		/* If value is NOT an internal object, we are done */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 		if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) !=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) 		    ACPI_DESC_TYPE_OPERAND) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) 			goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 		/* Valid object, get the pointer to next level, if any */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 		switch (obj_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) 		case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 		case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) 			 * NOTE: takes advantage of common fields between string/buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 			bytes_to_dump = obj_desc->string.length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) 			obj_desc = (void *)obj_desc->string.pointer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 			acpi_os_printf("(Buffer/String pointer %p length %X)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) 				       obj_desc, bytes_to_dump);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) 			ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 			goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) 		case ACPI_TYPE_BUFFER_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) 			obj_desc =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 			    (union acpi_operand_object *)obj_desc->buffer_field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 			    buffer_obj;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 		case ACPI_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) 			obj_desc = (void *)obj_desc->package.elements;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) 		case ACPI_TYPE_METHOD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 			obj_desc = (void *)obj_desc->method.aml_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 		case ACPI_TYPE_LOCAL_REGION_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) 			obj_desc = (void *)obj_desc->field.region_obj;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) 		case ACPI_TYPE_LOCAL_BANK_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) 			obj_desc = (void *)obj_desc->bank_field.region_obj;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) 			obj_desc = (void *)obj_desc->index_field.index_obj;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 			goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) cleanup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) 	return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601)  * FUNCTION:    acpi_ns_dump_objects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603)  * PARAMETERS:  type                - Object type to be dumped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604)  *              display_type        - 0 or ACPI_DISPLAY_SUMMARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605)  *              max_depth           - Maximum depth of dump. Use ACPI_UINT32_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)  *                                    for an effectively unlimited depth.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)  *              owner_id            - Dump only objects owned by this ID. Use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608)  *                                    ACPI_UINT32_MAX to match all owners.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)  *              start_handle        - Where in namespace to start/end search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613)  * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614)  *              acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) acpi_ns_dump_objects(acpi_object_type type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) 		     u8 display_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) 		     u32 max_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) 		     acpi_owner_id owner_id, acpi_handle start_handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) 	struct acpi_walk_info info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) 	 * Just lock the entire namespace for the duration of the dump.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) 	 * We don't want any changes to the namespace during this time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) 	 * especially the temporary nodes since we are going to display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) 	 * them also.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) 	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) 	if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) 		acpi_os_printf("Could not acquire namespace mutex\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) 	info.count = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) 	info.debug_level = ACPI_LV_TABLES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) 	info.owner_id = owner_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) 	info.display_type = display_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) 	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) 				     ACPI_NS_WALK_NO_UNLOCK |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) 				     ACPI_NS_WALK_TEMP_NODES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) 				     acpi_ns_dump_one_object, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) 				     (void *)&info, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) 	acpi_os_printf("\nNamespace node count: %u\n\n", info.count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658)  * FUNCTION:    acpi_ns_dump_one_object_path, acpi_ns_get_max_depth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660)  * PARAMETERS:  obj_handle          - Node to be dumped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661)  *              level               - Nesting level of the handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662)  *              context             - Passed into walk_namespace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663)  *              return_value        - Not used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667)  * DESCRIPTION: Dump the full pathname to a namespace object. acp_ns_get_max_depth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668)  *              computes the maximum nesting depth in the namespace tree, in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)  *              order to simplify formatting in acpi_ns_dump_one_object_path.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670)  *              These procedures are user_functions called by acpi_ns_walk_namespace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) acpi_ns_dump_one_object_path(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) 			     u32 level, void *context, void **return_value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) 	u32 max_level = *((u32 *)context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) 	char *pathname;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) 	struct acpi_namespace_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) 	int path_indent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) 	if (!obj_handle) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) 	node = acpi_ns_validate_handle(obj_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) 	if (!node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) 		/* Ignore bad node during namespace walk */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) 	pathname = acpi_ns_get_normalized_pathname(node, TRUE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) 	path_indent = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) 	if (level <= max_level) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) 		path_indent = max_level - level + 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) 	acpi_os_printf("%2d%*s%-12s%*s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) 		       level, level, " ", acpi_ut_get_type_name(node->type),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) 		       path_indent, " ");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) 	acpi_os_printf("%s\n", &pathname[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) 	ACPI_FREE(pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) 	return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) acpi_ns_get_max_depth(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) 		      u32 level, void *context, void **return_value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) 	u32 *max_level = (u32 *)context;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) 	if (level > *max_level) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) 		*max_level = level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) 	return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725)  * FUNCTION:    acpi_ns_dump_object_paths
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727)  * PARAMETERS:  type                - Object type to be dumped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728)  *              display_type        - 0 or ACPI_DISPLAY_SUMMARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729)  *              max_depth           - Maximum depth of dump. Use ACPI_UINT32_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730)  *                                    for an effectively unlimited depth.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731)  *              owner_id            - Dump only objects owned by this ID. Use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732)  *                                    ACPI_UINT32_MAX to match all owners.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733)  *              start_handle        - Where in namespace to start/end search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737)  * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738)  *              acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object_path.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) acpi_ns_dump_object_paths(acpi_object_type type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) 			  u8 display_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) 			  u32 max_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) 			  acpi_owner_id owner_id, acpi_handle start_handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) 	u32 max_level = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) 	 * Just lock the entire namespace for the duration of the dump.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) 	 * We don't want any changes to the namespace during this time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) 	 * especially the temporary nodes since we are going to display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) 	 * them also.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) 	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) 	if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) 		acpi_os_printf("Could not acquire namespace mutex\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) 	/* Get the max depth of the namespace tree, for formatting later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) 	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) 				     ACPI_NS_WALK_NO_UNLOCK |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) 				     ACPI_NS_WALK_TEMP_NODES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) 				     acpi_ns_get_max_depth, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) 				     (void *)&max_level, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) 	/* Now dump the entire namespace */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) 	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) 				     ACPI_NS_WALK_NO_UNLOCK |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) 				     ACPI_NS_WALK_TEMP_NODES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) 				     acpi_ns_dump_one_object_path, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) 				     (void *)&max_level, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786)  * FUNCTION:    acpi_ns_dump_entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788)  * PARAMETERS:  handle              - Node to be dumped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789)  *              debug_level         - Output level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793)  * DESCRIPTION: Dump a single Node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) 	struct acpi_walk_info info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) 	info.debug_level = debug_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) 	info.owner_id = ACPI_OWNER_ID_MAX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) 	info.display_type = ACPI_DISPLAY_SUMMARY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) 	(void)acpi_ns_dump_one_object(handle, 1, &info, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) #ifdef ACPI_ASL_COMPILER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813)  * FUNCTION:    acpi_ns_dump_tables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815)  * PARAMETERS:  search_base         - Root of subtree to be dumped, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816)  *                                    NS_ALL to dump the entire namespace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817)  *              max_depth           - Maximum depth of dump. Use INT_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818)  *                                    for an effectively unlimited depth.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822)  * DESCRIPTION: Dump the name space, or a portion of it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) 	acpi_handle search_handle = search_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) 	ACPI_FUNCTION_TRACE(ns_dump_tables);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832) 	if (!acpi_gbl_root_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834) 		 * If the name space has not been initialized,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) 		 * there is nothing to dump.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837) 		ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) 				  "namespace not initialized!\n"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) 	if (ACPI_NS_ALL == search_base) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) 		/* Entire namespace */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) 		search_handle = acpi_gbl_root_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847) 		ACPI_DEBUG_PRINT((ACPI_DB_TABLES, "\\\n"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) 	acpi_ns_dump_objects(ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) 			     ACPI_OWNER_ID_MAX, search_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) 	return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) #endif