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: dbstats - Generation and display of ACPI table statistics
^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 "acdebug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "acnamesp.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("dbstats")
^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_count_namespace_objects(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) static void acpi_db_enumerate_object(union acpi_operand_object *obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) acpi_db_classify_one_object(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 			    u32 nesting_level,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 			    void *context, void **return_value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #if defined ACPI_DBG_TRACK_ALLOCATIONS || defined ACPI_USE_LOCAL_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) static void acpi_db_list_info(struct acpi_memory_list *list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * Statistics subcommands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static struct acpi_db_argument_info acpi_db_stat_types[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	{"ALLOCATIONS"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	{"OBJECTS"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	{"MEMORY"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	{"MISC"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	{"TABLES"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	{"SIZES"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	{"STACK"},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	{NULL}			/* Must be null terminated */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #define CMD_STAT_ALLOCATIONS     0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define CMD_STAT_OBJECTS         1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define CMD_STAT_MEMORY          2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define CMD_STAT_MISC            3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define CMD_STAT_TABLES          4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #define CMD_STAT_SIZES           5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define CMD_STAT_STACK           6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #if defined ACPI_DBG_TRACK_ALLOCATIONS || defined ACPI_USE_LOCAL_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  * FUNCTION:    acpi_db_list_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  * PARAMETERS:  list            - Memory list/cache to be displayed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  * DESCRIPTION: Display information about the input memory list or cache.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) static void acpi_db_list_info(struct acpi_memory_list *list)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #ifdef ACPI_DBG_TRACK_ALLOCATIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	u32 outstanding;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	acpi_os_printf("\n%s\n", list->list_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	/* max_depth > 0 indicates a cache object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	if (list->max_depth > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		    ("    Cache: [Depth    MaxD Avail  Size]                "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		     "%8.2X %8.2X %8.2X %8.2X\n", list->current_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		     list->max_depth, list->max_depth - list->current_depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		     (list->current_depth * list->object_size));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #ifdef ACPI_DBG_TRACK_ALLOCATIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	if (list->max_depth > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		    ("    Cache: [Requests Hits Misses ObjSize]             "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		     "%8.2X %8.2X %8.2X %8.2X\n", list->requests, list->hits,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		     list->requests - list->hits, list->object_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	outstanding = acpi_db_get_cache_info(list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	if (list->object_size) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		    ("    Mem:   [Alloc    Free Max    CurSize Outstanding] "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		     "%8.2X %8.2X %8.2X %8.2X %8.2X\n", list->total_allocated,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		     list->total_freed, list->max_occupied,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		     outstanding * list->object_size, outstanding);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		    ("    Mem:   [Alloc Free Max CurSize Outstanding Total] "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		     "%8.2X %8.2X %8.2X %8.2X %8.2X %8.2X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		     list->total_allocated, list->total_freed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		     list->max_occupied, list->current_total_size, outstanding,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		     list->total_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  * FUNCTION:    acpi_db_enumerate_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  * PARAMETERS:  obj_desc            - Object to be counted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * DESCRIPTION: Add this object to the global counts, by object type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  *              Limited recursion handles subobjects and packages, and this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  *              is probably acceptable within the AML debugger only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  *
^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) static void acpi_db_enumerate_object(union acpi_operand_object *obj_desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	/* Enumerate this object first */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	acpi_gbl_num_objects++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	if (obj_desc->common.type > ACPI_TYPE_NS_NODE_MAX) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		acpi_gbl_obj_type_count_misc++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		acpi_gbl_obj_type_count[obj_desc->common.type]++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	/* Count the sub-objects */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	switch (obj_desc->common.type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	case ACPI_TYPE_PACKAGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		for (i = 0; i < obj_desc->package.count; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 			acpi_db_enumerate_object(obj_desc->package.elements[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	case ACPI_TYPE_DEVICE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		acpi_db_enumerate_object(obj_desc->device.notify_list[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		acpi_db_enumerate_object(obj_desc->device.notify_list[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		acpi_db_enumerate_object(obj_desc->device.handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	case ACPI_TYPE_BUFFER_FIELD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		if (acpi_ns_get_secondary_object(obj_desc)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 			acpi_gbl_obj_type_count[ACPI_TYPE_BUFFER_FIELD]++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	case ACPI_TYPE_REGION:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		acpi_gbl_obj_type_count[ACPI_TYPE_LOCAL_REGION_FIELD]++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		acpi_db_enumerate_object(obj_desc->region.handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	case ACPI_TYPE_POWER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		acpi_db_enumerate_object(obj_desc->power_resource.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 					 notify_list[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		acpi_db_enumerate_object(obj_desc->power_resource.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 					 notify_list[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	case ACPI_TYPE_PROCESSOR:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		acpi_db_enumerate_object(obj_desc->processor.notify_list[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		acpi_db_enumerate_object(obj_desc->processor.notify_list[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		acpi_db_enumerate_object(obj_desc->processor.handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	case ACPI_TYPE_THERMAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		acpi_db_enumerate_object(obj_desc->thermal_zone.notify_list[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		acpi_db_enumerate_object(obj_desc->thermal_zone.notify_list[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		acpi_db_enumerate_object(obj_desc->thermal_zone.handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) }
^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)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)  * FUNCTION:    acpi_db_classify_one_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  * PARAMETERS:  Callback for walk_namespace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)  * DESCRIPTION: Enumerate both the object descriptor (including subobjects) and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)  *              the parent namespace node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) static acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) acpi_db_classify_one_object(acpi_handle obj_handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			    u32 nesting_level,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 			    void *context, void **return_value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	struct acpi_namespace_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	u32 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	acpi_gbl_num_nodes++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	node = (struct acpi_namespace_node *)obj_handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	obj_desc = acpi_ns_get_attached_object(node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	acpi_db_enumerate_object(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	type = node->type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	if (type > ACPI_TYPE_NS_NODE_MAX) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		acpi_gbl_node_type_count_misc++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		acpi_gbl_node_type_count[type]++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #ifdef ACPI_FUTURE_IMPLEMENTATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	/* TBD: These need to be counted during the initial parsing phase */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	if (acpi_ps_is_named_op(op->opcode)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 		num_nodes++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	if (is_method) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 		num_method_elements++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	num_grammar_elements++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	op = acpi_ps_get_depth_next(root, op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	size_of_parse_tree = (num_grammar_elements - num_method_elements) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	    (u32)sizeof(union acpi_parse_object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	size_of_method_trees =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	    num_method_elements * (u32)sizeof(union acpi_parse_object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	size_of_node_entries =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	    num_nodes * (u32)sizeof(struct acpi_namespace_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	size_of_acpi_objects =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	    num_nodes * (u32)sizeof(union acpi_operand_object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  * FUNCTION:    acpi_db_count_namespace_objects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)  * PARAMETERS:  None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)  * DESCRIPTION: Count and classify the entire namespace, including all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)  *              namespace nodes and attached objects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) static void acpi_db_count_namespace_objects(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	acpi_gbl_num_nodes = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	acpi_gbl_num_objects = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	acpi_gbl_obj_type_count_misc = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	for (i = 0; i < (ACPI_TYPE_NS_NODE_MAX - 1); i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 		acpi_gbl_obj_type_count[i] = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 		acpi_gbl_node_type_count[i] = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 	(void)acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 				     ACPI_UINT32_MAX, FALSE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 				     acpi_db_classify_one_object, NULL, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 				     NULL);
^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)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)  * FUNCTION:    acpi_db_display_statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)  * PARAMETERS:  type_arg        - Subcommand
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)  * DESCRIPTION: Display various statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) acpi_status acpi_db_display_statistics(char *type_arg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 	u32 temp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	acpi_ut_strupr(type_arg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	temp = acpi_db_match_argument(type_arg, acpi_db_stat_types);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	if (temp == ACPI_TYPE_NOT_FOUND) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 		acpi_os_printf("Invalid or unsupported argument\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 		return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	switch (temp) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 	case CMD_STAT_ALLOCATIONS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) #ifdef ACPI_DBG_TRACK_ALLOCATIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 		acpi_ut_dump_allocation_info();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	case CMD_STAT_TABLES:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 		acpi_os_printf("ACPI Table Information (not implemented):\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	case CMD_STAT_OBJECTS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 		acpi_db_count_namespace_objects();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 		    ("\nObjects defined in the current namespace:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 		acpi_os_printf("%16.16s %10.10s %10.10s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 			       "ACPI_TYPE", "NODES", "OBJECTS");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 		for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 			acpi_os_printf("%16.16s %10u %10u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 				       acpi_ut_get_type_name(i),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 				       acpi_gbl_node_type_count[i],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 				       acpi_gbl_obj_type_count[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 		acpi_os_printf("%16.16s %10u %10u\n", "Misc/Unknown",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 			       acpi_gbl_node_type_count_misc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 			       acpi_gbl_obj_type_count_misc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 		acpi_os_printf("%16.16s %10u %10u\n", "TOTALS:",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 			       acpi_gbl_num_nodes, acpi_gbl_num_objects);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	case CMD_STAT_MEMORY:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #ifdef ACPI_DBG_TRACK_ALLOCATIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 		    ("\n----Object Statistics (all in hex)---------\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 		acpi_db_list_info(acpi_gbl_global_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 		acpi_db_list_info(acpi_gbl_ns_node_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) #ifdef ACPI_USE_LOCAL_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 		acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 		    ("\n----Cache Statistics (all in hex)---------\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		acpi_db_list_info(acpi_gbl_operand_cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 		acpi_db_list_info(acpi_gbl_ps_node_cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 		acpi_db_list_info(acpi_gbl_ps_node_ext_cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 		acpi_db_list_info(acpi_gbl_state_cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	case CMD_STAT_MISC:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 		acpi_os_printf("\nMiscellaneous Statistics:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 		acpi_os_printf("%-28s:     %7u\n", "Calls to AcpiPsFind",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 			       acpi_gbl_ps_find_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 		acpi_os_printf("%-28s:     %7u\n", "Calls to AcpiNsLookup",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 			       acpi_gbl_ns_lookup_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 		acpi_os_printf("\nMutex usage:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 		for (i = 0; i < ACPI_NUM_MUTEX; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 			acpi_os_printf("%-28s:     %7u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 				       acpi_ut_get_mutex_name(i),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 				       acpi_gbl_mutex_info[i].use_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	case CMD_STAT_SIZES:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 		acpi_os_printf("\nInternal object sizes:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 		acpi_os_printf("Common         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 			       (u32)sizeof(struct acpi_object_common));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 		acpi_os_printf("Number         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 			       (u32)sizeof(struct acpi_object_integer));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 		acpi_os_printf("String         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 			       (u32)sizeof(struct acpi_object_string));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 		acpi_os_printf("Buffer         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 			       (u32)sizeof(struct acpi_object_buffer));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 		acpi_os_printf("Package        %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 			       (u32)sizeof(struct acpi_object_package));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 		acpi_os_printf("BufferField    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 			       (u32)sizeof(struct acpi_object_buffer_field));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 		acpi_os_printf("Device         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 			       (u32)sizeof(struct acpi_object_device));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 		acpi_os_printf("Event          %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 			       (u32)sizeof(struct acpi_object_event));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 		acpi_os_printf("Method         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 			       (u32)sizeof(struct acpi_object_method));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 		acpi_os_printf("Mutex          %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 			       (u32)sizeof(struct acpi_object_mutex));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 		acpi_os_printf("Region         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 			       (u32)sizeof(struct acpi_object_region));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 		acpi_os_printf("PowerResource  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 			       (u32)sizeof(struct acpi_object_power_resource));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 		acpi_os_printf("Processor      %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 			       (u32)sizeof(struct acpi_object_processor));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 		acpi_os_printf("ThermalZone    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 			       (u32)sizeof(struct acpi_object_thermal_zone));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 		acpi_os_printf("RegionField    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 			       (u32)sizeof(struct acpi_object_region_field));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 		acpi_os_printf("BankField      %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 			       (u32)sizeof(struct acpi_object_bank_field));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 		acpi_os_printf("IndexField     %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 			       (u32)sizeof(struct acpi_object_index_field));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 		acpi_os_printf("Reference      %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 			       (u32)sizeof(struct acpi_object_reference));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 		acpi_os_printf("Notify         %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 			       (u32)sizeof(struct acpi_object_notify_handler));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 		acpi_os_printf("AddressSpace   %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 			       (u32)sizeof(struct acpi_object_addr_handler));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 		acpi_os_printf("Extra          %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 			       (u32)sizeof(struct acpi_object_extra));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 		acpi_os_printf("Data           %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 			       (u32)sizeof(struct acpi_object_data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 		acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 		acpi_os_printf("ParseObject    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 			       (u32)sizeof(struct acpi_parse_obj_common));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 		acpi_os_printf("ParseObjectNamed %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 			       (u32)sizeof(struct acpi_parse_obj_named));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 		acpi_os_printf("ParseObjectAsl %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 			       (u32)sizeof(struct acpi_parse_obj_asl));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 		acpi_os_printf("OperandObject  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 			       (u32)sizeof(union acpi_operand_object));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 		acpi_os_printf("NamespaceNode  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 			       (u32)sizeof(struct acpi_namespace_node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 		acpi_os_printf("AcpiObject     %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 			       (u32)sizeof(union acpi_object));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 		acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 		acpi_os_printf("Generic State  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 			       (u32)sizeof(union acpi_generic_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 		acpi_os_printf("Common State   %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 			       (u32)sizeof(struct acpi_common_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 		acpi_os_printf("Control State  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 			       (u32)sizeof(struct acpi_control_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 		acpi_os_printf("Update State   %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 			       (u32)sizeof(struct acpi_update_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 		acpi_os_printf("Scope State    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 			       (u32)sizeof(struct acpi_scope_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 		acpi_os_printf("Parse Scope    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 			       (u32)sizeof(struct acpi_pscope_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 		acpi_os_printf("Package State  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 			       (u32)sizeof(struct acpi_pkg_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 		acpi_os_printf("Thread State   %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 			       (u32)sizeof(struct acpi_thread_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 		acpi_os_printf("Result Values  %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 			       (u32)sizeof(struct acpi_result_values));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 		acpi_os_printf("Notify Info    %3d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 			       (u32)sizeof(struct acpi_notify_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 	case CMD_STAT_STACK:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) #if defined(ACPI_DEBUG_OUTPUT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 		temp =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 		    (u32)ACPI_PTR_DIFF(acpi_gbl_entry_stack_pointer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 				       acpi_gbl_lowest_stack_pointer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 		acpi_os_printf("\nSubsystem Stack Usage:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 		acpi_os_printf("Entry Stack Pointer        %p\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 			       acpi_gbl_entry_stack_pointer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 		acpi_os_printf("Lowest Stack Pointer       %p\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 			       acpi_gbl_lowest_stack_pointer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 		acpi_os_printf("Stack Use                  %X (%u)\n", temp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 			       temp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 		acpi_os_printf("Deepest Procedure Nesting  %u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 			       acpi_gbl_deepest_nesting);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 	return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) }