| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** | 
|  | 2 | * | 
|  | 3 | * Module Name: exdump - Interpreter debug output routines | 
|  | 4 | * | 
|  | 5 | *****************************************************************************/ | 
|  | 6 |  | 
|  | 7 | /* | 
|  | 8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 
|  | 9 | * All rights reserved. | 
|  | 10 | * | 
|  | 11 | * Redistribution and use in source and binary forms, with or without | 
|  | 12 | * modification, are permitted provided that the following conditions | 
|  | 13 | * are met: | 
|  | 14 | * 1. Redistributions of source code must retain the above copyright | 
|  | 15 | *    notice, this list of conditions, and the following disclaimer, | 
|  | 16 | *    without modification. | 
|  | 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | 
|  | 18 | *    substantially similar to the "NO WARRANTY" disclaimer below | 
|  | 19 | *    ("Disclaimer") and any redistribution must be conditioned upon | 
|  | 20 | *    including a substantially similar Disclaimer requirement for further | 
|  | 21 | *    binary redistribution. | 
|  | 22 | * 3. Neither the names of the above-listed copyright holders nor the names | 
|  | 23 | *    of any contributors may be used to endorse or promote products derived | 
|  | 24 | *    from this software without specific prior written permission. | 
|  | 25 | * | 
|  | 26 | * Alternatively, this software may be distributed under the terms of the | 
|  | 27 | * GNU General Public License ("GPL") version 2 as published by the Free | 
|  | 28 | * Software Foundation. | 
|  | 29 | * | 
|  | 30 | * NO WARRANTY | 
|  | 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
|  | 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|  | 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | 
|  | 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 
|  | 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
|  | 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 
|  | 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 
|  | 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 
|  | 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 
|  | 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 
|  | 41 | * POSSIBILITY OF SUCH DAMAGES. | 
|  | 42 | */ | 
|  | 43 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> | 
|  | 45 | #include <acpi/acinterp.h> | 
|  | 46 | #include <acpi/amlcode.h> | 
|  | 47 | #include <acpi/acnamesp.h> | 
|  | 48 | #include <acpi/acparser.h> | 
|  | 49 |  | 
|  | 50 | #define _COMPONENT          ACPI_EXECUTER | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 51 | ACPI_MODULE_NAME("exdump") | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 |  | 
| Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 53 | /* | 
|  | 54 | * The following routines are used for debug output only | 
|  | 55 | */ | 
|  | 56 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 57 | /* Local prototypes */ | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 58 | #ifdef ACPI_FUTURE_USAGE | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 59 | static void acpi_ex_out_string(char *title, char *value); | 
|  | 60 |  | 
|  | 61 | static void acpi_ex_out_pointer(char *title, void *value); | 
|  | 62 |  | 
|  | 63 | static void acpi_ex_out_integer(char *title, u32 value); | 
|  | 64 |  | 
|  | 65 | static void acpi_ex_out_address(char *title, acpi_physical_address value); | 
|  | 66 |  | 
|  | 67 | static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc); | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 68 |  | 
|  | 69 | static void | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 70 | acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index); | 
|  | 71 | #endif				/* ACPI_FUTURE_USAGE */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 |  | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 73 | /******************************************************************************* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | * | 
|  | 75 | * FUNCTION:    acpi_ex_dump_operand | 
|  | 76 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 77 | * PARAMETERS:  *obj_desc       - Pointer to entry to be dumped | 
|  | 78 | *              Depth           - Current nesting depth | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | * | 
|  | 80 | * RETURN:      None | 
|  | 81 | * | 
|  | 82 | * DESCRIPTION: Dump an operand object | 
|  | 83 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 84 | ******************************************************************************/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 86 | void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 88 | u32 length; | 
|  | 89 | u32 index; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 91 | ACPI_FUNCTION_NAME("ex_dump_operand") | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 93 | if (! | 
|  | 94 | ((ACPI_LV_EXEC & acpi_dbg_level) | 
|  | 95 | && (_COMPONENT & acpi_dbg_layer))) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | return; | 
|  | 97 | } | 
|  | 98 |  | 
|  | 99 | if (!obj_desc) { | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 100 | /* This could be a null element of a package */ | 
|  | 101 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 102 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n")); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | return; | 
|  | 104 | } | 
|  | 105 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 106 | if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) { | 
|  | 107 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Namespace Node: ", | 
|  | 108 | obj_desc)); | 
|  | 109 | ACPI_DUMP_ENTRY(obj_desc, ACPI_LV_EXEC); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | return; | 
|  | 111 | } | 
|  | 112 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 113 | if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) { | 
|  | 114 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 
|  | 115 | "%p is not a node or operand object: [%s]\n", | 
|  | 116 | obj_desc, | 
|  | 117 | acpi_ut_get_descriptor_name(obj_desc))); | 
|  | 118 | ACPI_DUMP_BUFFER(obj_desc, sizeof(union acpi_operand_object)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | return; | 
|  | 120 | } | 
|  | 121 |  | 
|  | 122 | /* obj_desc is a valid object */ | 
|  | 123 |  | 
|  | 124 | if (depth > 0) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 125 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ", | 
|  | 126 | depth, " ", depth, obj_desc)); | 
|  | 127 | } else { | 
|  | 128 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | } | 
|  | 130 |  | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 131 | /* Decode object type */ | 
|  | 132 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 133 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | case ACPI_TYPE_LOCAL_REFERENCE: | 
|  | 135 |  | 
|  | 136 | switch (obj_desc->reference.opcode) { | 
|  | 137 | case AML_DEBUG_OP: | 
|  | 138 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 139 | acpi_os_printf("Reference: Debug\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | break; | 
|  | 141 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | case AML_NAME_OP: | 
|  | 143 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 144 | ACPI_DUMP_PATHNAME(obj_desc->reference.object, | 
|  | 145 | "Reference: Name: ", ACPI_LV_INFO, | 
|  | 146 | _COMPONENT); | 
|  | 147 | ACPI_DUMP_ENTRY(obj_desc->reference.object, | 
|  | 148 | ACPI_LV_INFO); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | break; | 
|  | 150 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | case AML_INDEX_OP: | 
|  | 152 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 153 | acpi_os_printf("Reference: Index %p\n", | 
|  | 154 | obj_desc->reference.object); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | break; | 
|  | 156 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | case AML_REF_OF_OP: | 
|  | 158 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 159 | acpi_os_printf("Reference: (ref_of) %p\n", | 
|  | 160 | obj_desc->reference.object); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | break; | 
|  | 162 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | case AML_ARG_OP: | 
|  | 164 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 165 | acpi_os_printf("Reference: Arg%d", | 
|  | 166 | obj_desc->reference.offset); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 168 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | /* Value is an Integer */ | 
|  | 170 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 171 | acpi_os_printf(" value is [%8.8X%8.8x]", | 
|  | 172 | ACPI_FORMAT_UINT64(obj_desc-> | 
|  | 173 | integer. | 
|  | 174 | value)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | } | 
|  | 176 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 177 | acpi_os_printf("\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | break; | 
|  | 179 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | case AML_LOCAL_OP: | 
|  | 181 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 182 | acpi_os_printf("Reference: Local%d", | 
|  | 183 | obj_desc->reference.offset); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 185 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 |  | 
|  | 187 | /* Value is an Integer */ | 
|  | 188 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 189 | acpi_os_printf(" value is [%8.8X%8.8x]", | 
|  | 190 | ACPI_FORMAT_UINT64(obj_desc-> | 
|  | 191 | integer. | 
|  | 192 | value)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | } | 
|  | 194 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 195 | acpi_os_printf("\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | break; | 
|  | 197 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | case AML_INT_NAMEPATH_OP: | 
|  | 199 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 200 | acpi_os_printf("Reference.Node->Name %X\n", | 
|  | 201 | obj_desc->reference.node->name.integer); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | break; | 
|  | 203 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | default: | 
|  | 205 |  | 
|  | 206 | /* Unknown opcode */ | 
|  | 207 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 208 | acpi_os_printf("Unknown Reference opcode=%X\n", | 
|  | 209 | obj_desc->reference.opcode); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | break; | 
|  | 211 |  | 
|  | 212 | } | 
|  | 213 | break; | 
|  | 214 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | case ACPI_TYPE_BUFFER: | 
|  | 216 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 217 | acpi_os_printf("Buffer len %X @ %p \n", | 
|  | 218 | obj_desc->buffer.length, | 
|  | 219 | obj_desc->buffer.pointer); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 |  | 
|  | 221 | length = obj_desc->buffer.length; | 
|  | 222 | if (length > 64) { | 
|  | 223 | length = 64; | 
|  | 224 | } | 
|  | 225 |  | 
|  | 226 | /* Debug only -- dump the buffer contents */ | 
|  | 227 |  | 
|  | 228 | if (obj_desc->buffer.pointer) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 229 | acpi_os_printf("Buffer Contents: "); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 |  | 
|  | 231 | for (index = 0; index < length; index++) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 232 | acpi_os_printf(" %02x", | 
|  | 233 | obj_desc->buffer.pointer[index]); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | } | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 235 | acpi_os_printf("\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | } | 
|  | 237 | break; | 
|  | 238 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | case ACPI_TYPE_INTEGER: | 
|  | 240 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 241 | acpi_os_printf("Integer %8.8X%8.8X\n", | 
|  | 242 | ACPI_FORMAT_UINT64(obj_desc->integer.value)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | break; | 
|  | 244 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | case ACPI_TYPE_PACKAGE: | 
|  | 246 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 247 | acpi_os_printf("Package [Len %X] element_array %p\n", | 
|  | 248 | obj_desc->package.count, | 
|  | 249 | obj_desc->package.elements); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 |  | 
|  | 251 | /* | 
|  | 252 | * If elements exist, package element pointer is valid, | 
|  | 253 | * and debug_level exceeds 1, dump package's elements. | 
|  | 254 | */ | 
|  | 255 | if (obj_desc->package.count && | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 256 | obj_desc->package.elements && acpi_dbg_level > 1) { | 
|  | 257 | for (index = 0; index < obj_desc->package.count; | 
|  | 258 | index++) { | 
|  | 259 | acpi_ex_dump_operand(obj_desc->package. | 
|  | 260 | elements[index], | 
|  | 261 | depth + 1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | } | 
|  | 263 | } | 
|  | 264 | break; | 
|  | 265 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | case ACPI_TYPE_REGION: | 
|  | 267 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 268 | acpi_os_printf("Region %s (%X)", | 
|  | 269 | acpi_ut_get_region_name(obj_desc->region. | 
|  | 270 | space_id), | 
|  | 271 | obj_desc->region.space_id); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 |  | 
|  | 273 | /* | 
|  | 274 | * If the address and length have not been evaluated, | 
|  | 275 | * don't print them. | 
|  | 276 | */ | 
|  | 277 | if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 278 | acpi_os_printf("\n"); | 
|  | 279 | } else { | 
|  | 280 | acpi_os_printf(" base %8.8X%8.8X Length %X\n", | 
|  | 281 | ACPI_FORMAT_UINT64(obj_desc->region. | 
|  | 282 | address), | 
|  | 283 | obj_desc->region.length); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | } | 
|  | 285 | break; | 
|  | 286 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | case ACPI_TYPE_STRING: | 
|  | 288 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 289 | acpi_os_printf("String length %X @ %p ", | 
|  | 290 | obj_desc->string.length, | 
|  | 291 | obj_desc->string.pointer); | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 292 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 293 | acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX); | 
|  | 294 | acpi_os_printf("\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | break; | 
|  | 296 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | case ACPI_TYPE_LOCAL_BANK_FIELD: | 
|  | 298 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 299 | acpi_os_printf("bank_field\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | break; | 
|  | 301 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | case ACPI_TYPE_LOCAL_REGION_FIELD: | 
|  | 303 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 304 | acpi_os_printf | 
|  | 305 | ("region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", | 
|  | 306 | obj_desc->field.bit_length, | 
|  | 307 | obj_desc->field.access_byte_width, | 
|  | 308 | obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK, | 
|  | 309 | obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK, | 
|  | 310 | obj_desc->field.base_byte_offset, | 
|  | 311 | obj_desc->field.start_field_bit_offset); | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 312 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 313 | acpi_ex_dump_operand(obj_desc->field.region_obj, depth + 1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | break; | 
|  | 315 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | case ACPI_TYPE_LOCAL_INDEX_FIELD: | 
|  | 317 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 318 | acpi_os_printf("index_field\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | break; | 
|  | 320 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | case ACPI_TYPE_BUFFER_FIELD: | 
|  | 322 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 323 | acpi_os_printf("buffer_field: %X bits at byte %X bit %X of \n", | 
|  | 324 | obj_desc->buffer_field.bit_length, | 
|  | 325 | obj_desc->buffer_field.base_byte_offset, | 
|  | 326 | obj_desc->buffer_field.start_field_bit_offset); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 |  | 
|  | 328 | if (!obj_desc->buffer_field.buffer_obj) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 329 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL* \n")); | 
|  | 330 | } else | 
|  | 331 | if (ACPI_GET_OBJECT_TYPE(obj_desc->buffer_field.buffer_obj) | 
|  | 332 | != ACPI_TYPE_BUFFER) { | 
|  | 333 | acpi_os_printf("*not a Buffer* \n"); | 
|  | 334 | } else { | 
|  | 335 | acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj, | 
|  | 336 | depth + 1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | } | 
|  | 338 | break; | 
|  | 339 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | case ACPI_TYPE_EVENT: | 
|  | 341 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 342 | acpi_os_printf("Event\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 343 | break; | 
|  | 344 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | case ACPI_TYPE_METHOD: | 
|  | 346 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 347 | acpi_os_printf("Method(%X) @ %p:%X\n", | 
|  | 348 | obj_desc->method.param_count, | 
|  | 349 | obj_desc->method.aml_start, | 
|  | 350 | obj_desc->method.aml_length); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | break; | 
|  | 352 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 353 | case ACPI_TYPE_MUTEX: | 
|  | 354 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 355 | acpi_os_printf("Mutex\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | break; | 
|  | 357 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 358 | case ACPI_TYPE_DEVICE: | 
|  | 359 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 360 | acpi_os_printf("Device\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | break; | 
|  | 362 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | case ACPI_TYPE_POWER: | 
|  | 364 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 365 | acpi_os_printf("Power\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | break; | 
|  | 367 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | case ACPI_TYPE_PROCESSOR: | 
|  | 369 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 370 | acpi_os_printf("Processor\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | break; | 
|  | 372 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | case ACPI_TYPE_THERMAL: | 
|  | 374 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 375 | acpi_os_printf("Thermal\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | break; | 
|  | 377 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | default: | 
|  | 379 | /* Unknown Type */ | 
|  | 380 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 381 | acpi_os_printf("Unknown Type %X\n", | 
|  | 382 | ACPI_GET_OBJECT_TYPE(obj_desc)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | break; | 
|  | 384 | } | 
|  | 385 |  | 
|  | 386 | return; | 
|  | 387 | } | 
|  | 388 |  | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 389 | /******************************************************************************* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | * | 
|  | 391 | * FUNCTION:    acpi_ex_dump_operands | 
|  | 392 | * | 
|  | 393 | * PARAMETERS:  Operands            - Operand list | 
|  | 394 | *              interpreter_mode    - Load or Exec | 
|  | 395 | *              Ident               - Identification | 
|  | 396 | *              num_levels          - # of stack entries to dump above line | 
|  | 397 | *              Note                - Output notation | 
|  | 398 | *              module_name         - Caller's module name | 
|  | 399 | *              line_number         - Caller's invocation line number | 
|  | 400 | * | 
|  | 401 | * DESCRIPTION: Dump the object stack | 
|  | 402 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 403 | ******************************************************************************/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 |  | 
|  | 405 | void | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 406 | acpi_ex_dump_operands(union acpi_operand_object **operands, | 
|  | 407 | acpi_interpreter_mode interpreter_mode, | 
|  | 408 | char *ident, | 
|  | 409 | u32 num_levels, | 
|  | 410 | char *note, char *module_name, u32 line_number) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 412 | acpi_native_uint i; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 414 | ACPI_FUNCTION_NAME("ex_dump_operands"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 415 |  | 
|  | 416 | if (!ident) { | 
|  | 417 | ident = "?"; | 
|  | 418 | } | 
|  | 419 |  | 
|  | 420 | if (!note) { | 
|  | 421 | note = "?"; | 
|  | 422 | } | 
|  | 423 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 424 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 
|  | 425 | "************* Operand Stack Contents (Opcode [%s], %d Operands)\n", | 
|  | 426 | ident, num_levels)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 427 |  | 
|  | 428 | if (num_levels == 0) { | 
|  | 429 | num_levels = 1; | 
|  | 430 | } | 
|  | 431 |  | 
|  | 432 | /* Dump the operand stack starting at the top */ | 
|  | 433 |  | 
|  | 434 | for (i = 0; num_levels > 0; i--, num_levels--) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 435 | acpi_ex_dump_operand(operands[i], 0); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | } | 
|  | 437 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 438 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 
|  | 439 | "************* Operand Stack dump from %s(%d), %s\n", | 
|  | 440 | module_name, line_number, note)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | return; | 
|  | 442 | } | 
|  | 443 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 444 | #ifdef ACPI_FUTURE_USAGE | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 445 | /******************************************************************************* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 447 | * FUNCTION:    acpi_ex_out* functions | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 448 | * | 
|  | 449 | * PARAMETERS:  Title               - Descriptive text | 
|  | 450 | *              Value               - Value to be displayed | 
|  | 451 | * | 
|  | 452 | * DESCRIPTION: Object dump output formatting functions.  These functions | 
|  | 453 | *              reduce the number of format strings required and keeps them | 
|  | 454 | *              all in one place for easy modification. | 
|  | 455 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 456 | ******************************************************************************/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 458 | static void acpi_ex_out_string(char *title, char *value) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 459 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 460 | acpi_os_printf("%20s : %s\n", title, value); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | } | 
|  | 462 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 463 | static void acpi_ex_out_pointer(char *title, void *value) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 464 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 465 | acpi_os_printf("%20s : %p\n", title, value); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 466 | } | 
|  | 467 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 468 | static void acpi_ex_out_integer(char *title, u32 value) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 470 | acpi_os_printf("%20s : %.2X\n", title, value); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 471 | } | 
|  | 472 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 473 | static void acpi_ex_out_address(char *title, acpi_physical_address value) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 474 | { | 
|  | 475 |  | 
|  | 476 | #if ACPI_MACHINE_WIDTH == 16 | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 477 | acpi_os_printf("%20s : %p\n", title, value); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 478 | #else | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 479 | acpi_os_printf("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | #endif | 
|  | 481 | } | 
|  | 482 |  | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 483 | /******************************************************************************* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 484 | * | 
|  | 485 | * FUNCTION:    acpi_ex_dump_node | 
|  | 486 | * | 
|  | 487 | * PARAMETERS:  *Node               - Descriptor to dump | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 488 | *              Flags               - Force display if TRUE | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | * | 
|  | 490 | * DESCRIPTION: Dumps the members of the given.Node | 
|  | 491 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 492 | ******************************************************************************/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 494 | void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | { | 
|  | 496 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 497 | ACPI_FUNCTION_ENTRY(); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 |  | 
|  | 499 | if (!flags) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 500 | if (! | 
|  | 501 | ((ACPI_LV_OBJECTS & acpi_dbg_level) | 
|  | 502 | && (_COMPONENT & acpi_dbg_layer))) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | return; | 
|  | 504 | } | 
|  | 505 | } | 
|  | 506 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 507 | acpi_os_printf("%20s : %4.4s\n", "Name", acpi_ut_get_node_name(node)); | 
|  | 508 | acpi_ex_out_string("Type", acpi_ut_get_type_name(node->type)); | 
|  | 509 | acpi_ex_out_integer("Flags", node->flags); | 
|  | 510 | acpi_ex_out_integer("Owner Id", node->owner_id); | 
|  | 511 | acpi_ex_out_integer("Reference Count", node->reference_count); | 
|  | 512 | acpi_ex_out_pointer("Attached Object", | 
|  | 513 | acpi_ns_get_attached_object(node)); | 
|  | 514 | acpi_ex_out_pointer("child_list", node->child); | 
|  | 515 | acpi_ex_out_pointer("next_peer", node->peer); | 
|  | 516 | acpi_ex_out_pointer("Parent", acpi_ns_get_parent_node(node)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 517 | } | 
|  | 518 |  | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 519 | /******************************************************************************* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 520 | * | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 521 | * FUNCTION:    acpi_ex_dump_reference | 
|  | 522 | * | 
|  | 523 | * PARAMETERS:  Object              - Descriptor to dump | 
|  | 524 | * | 
|  | 525 | * DESCRIPTION: Dumps a reference object | 
|  | 526 | * | 
|  | 527 | ******************************************************************************/ | 
|  | 528 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 529 | static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc) | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 530 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 531 | struct acpi_buffer ret_buf; | 
|  | 532 | acpi_status status; | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 533 |  | 
|  | 534 | if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 535 | acpi_os_printf("Named Object %p ", obj_desc->reference.node); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 536 | ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER; | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 537 | status = | 
|  | 538 | acpi_ns_handle_to_pathname(obj_desc->reference.node, | 
|  | 539 | &ret_buf); | 
|  | 540 | if (ACPI_FAILURE(status)) { | 
|  | 541 | acpi_os_printf("Could not convert name to pathname\n"); | 
|  | 542 | } else { | 
|  | 543 | acpi_os_printf("%s\n", (char *)ret_buf.pointer); | 
|  | 544 | ACPI_MEM_FREE(ret_buf.pointer); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 545 | } | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 546 | } else if (obj_desc->reference.object) { | 
|  | 547 | acpi_os_printf("\nReferenced Object: %p\n", | 
|  | 548 | obj_desc->reference.object); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 549 | } | 
|  | 550 | } | 
|  | 551 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 552 | /******************************************************************************* | 
|  | 553 | * | 
|  | 554 | * FUNCTION:    acpi_ex_dump_package | 
|  | 555 | * | 
|  | 556 | * PARAMETERS:  Object              - Descriptor to dump | 
|  | 557 | *              Level               - Indentation Level | 
|  | 558 | *              Index               - Package index for this object | 
|  | 559 | * | 
|  | 560 | * DESCRIPTION: Dumps the elements of the package | 
|  | 561 | * | 
|  | 562 | ******************************************************************************/ | 
|  | 563 |  | 
|  | 564 | static void | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 565 | acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index) | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 566 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 567 | u32 i; | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 568 |  | 
|  | 569 | /* Indentation and index output */ | 
|  | 570 |  | 
|  | 571 | if (level > 0) { | 
|  | 572 | for (i = 0; i < level; i++) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 573 | acpi_os_printf(" "); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 574 | } | 
|  | 575 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 576 | acpi_os_printf("[%.2d] ", index); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 577 | } | 
|  | 578 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 579 | acpi_os_printf("%p ", obj_desc); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 580 |  | 
|  | 581 | /* Null package elements are allowed */ | 
|  | 582 |  | 
|  | 583 | if (!obj_desc) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 584 | acpi_os_printf("[Null Object]\n"); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 585 | return; | 
|  | 586 | } | 
|  | 587 |  | 
|  | 588 | /* Packages may only contain a few object types */ | 
|  | 589 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 590 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 591 | case ACPI_TYPE_INTEGER: | 
|  | 592 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 593 | acpi_os_printf("[Integer] = %8.8X%8.8X\n", | 
|  | 594 | ACPI_FORMAT_UINT64(obj_desc->integer.value)); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 595 | break; | 
|  | 596 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 597 | case ACPI_TYPE_STRING: | 
|  | 598 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 599 | acpi_os_printf("[String] Value: "); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 600 | for (i = 0; i < obj_desc->string.length; i++) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 601 | acpi_os_printf("%c", obj_desc->string.pointer[i]); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 602 | } | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 603 | acpi_os_printf("\n"); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 604 | break; | 
|  | 605 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 606 | case ACPI_TYPE_BUFFER: | 
|  | 607 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 608 | acpi_os_printf("[Buffer] Length %.2X = ", | 
|  | 609 | obj_desc->buffer.length); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 610 | if (obj_desc->buffer.length) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 611 | acpi_ut_dump_buffer((u8 *) obj_desc->buffer.pointer, | 
|  | 612 | obj_desc->buffer.length, | 
|  | 613 | DB_DWORD_DISPLAY, _COMPONENT); | 
|  | 614 | } else { | 
|  | 615 | acpi_os_printf("\n"); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 616 | } | 
|  | 617 | break; | 
|  | 618 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 619 | case ACPI_TYPE_PACKAGE: | 
|  | 620 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 621 | acpi_os_printf("[Package] Contains %d Elements: \n", | 
|  | 622 | obj_desc->package.count); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 623 |  | 
|  | 624 | for (i = 0; i < obj_desc->package.count; i++) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 625 | acpi_ex_dump_package(obj_desc->package.elements[i], | 
|  | 626 | level + 1, i); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 627 | } | 
|  | 628 | break; | 
|  | 629 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 630 | case ACPI_TYPE_LOCAL_REFERENCE: | 
|  | 631 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 632 | acpi_os_printf("[Object Reference] "); | 
|  | 633 | acpi_ex_dump_reference(obj_desc); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 634 | break; | 
|  | 635 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 636 | default: | 
|  | 637 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 638 | acpi_os_printf("[Unknown Type] %X\n", | 
|  | 639 | ACPI_GET_OBJECT_TYPE(obj_desc)); | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 640 | break; | 
|  | 641 | } | 
|  | 642 | } | 
|  | 643 |  | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 644 | /******************************************************************************* | 
|  | 645 | * | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 646 | * FUNCTION:    acpi_ex_dump_object_descriptor | 
|  | 647 | * | 
| Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 648 | * PARAMETERS:  Object              - Descriptor to dump | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 649 | *              Flags               - Force display if TRUE | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 650 | * | 
|  | 651 | * DESCRIPTION: Dumps the members of the object descriptor given. | 
|  | 652 | * | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 653 | ******************************************************************************/ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 654 |  | 
|  | 655 | void | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 656 | acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 657 | { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 658 | ACPI_FUNCTION_TRACE("ex_dump_object_descriptor"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 659 |  | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 660 | if (!obj_desc) { | 
|  | 661 | return_VOID; | 
|  | 662 | } | 
|  | 663 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 664 | if (!flags) { | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 665 | if (! | 
|  | 666 | ((ACPI_LV_OBJECTS & acpi_dbg_level) | 
|  | 667 | && (_COMPONENT & acpi_dbg_layer))) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 668 | return_VOID; | 
|  | 669 | } | 
|  | 670 | } | 
|  | 671 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 672 | if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) { | 
|  | 673 | acpi_ex_dump_node((struct acpi_namespace_node *)obj_desc, | 
|  | 674 | flags); | 
|  | 675 | acpi_os_printf("\nAttached Object (%p):\n", | 
|  | 676 | ((struct acpi_namespace_node *)obj_desc)-> | 
|  | 677 | object); | 
|  | 678 | acpi_ex_dump_object_descriptor(((struct acpi_namespace_node *) | 
|  | 679 | obj_desc)->object, flags); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | return_VOID; | 
|  | 681 | } | 
|  | 682 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 683 | if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) { | 
|  | 684 | acpi_os_printf | 
|  | 685 | ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n", | 
|  | 686 | obj_desc, acpi_ut_get_descriptor_name(obj_desc)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 687 | return_VOID; | 
|  | 688 | } | 
|  | 689 |  | 
|  | 690 | /* Common Fields */ | 
|  | 691 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 692 | acpi_ex_out_string("Type", acpi_ut_get_object_type_name(obj_desc)); | 
|  | 693 | acpi_ex_out_integer("Reference Count", | 
|  | 694 | obj_desc->common.reference_count); | 
|  | 695 | acpi_ex_out_integer("Flags", obj_desc->common.flags); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 696 |  | 
|  | 697 | /* Object-specific Fields */ | 
|  | 698 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 699 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 700 | case ACPI_TYPE_INTEGER: | 
|  | 701 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 702 | acpi_os_printf("%20s : %8.8X%8.8X\n", "Value", | 
|  | 703 | ACPI_FORMAT_UINT64(obj_desc->integer.value)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 704 | break; | 
|  | 705 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 706 | case ACPI_TYPE_STRING: | 
|  | 707 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 708 | acpi_ex_out_integer("Length", obj_desc->string.length); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 710 | acpi_os_printf("%20s : %p ", "Pointer", | 
|  | 711 | obj_desc->string.pointer); | 
|  | 712 | acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX); | 
|  | 713 | acpi_os_printf("\n"); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 714 | break; | 
|  | 715 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 716 | case ACPI_TYPE_BUFFER: | 
|  | 717 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 718 | acpi_ex_out_integer("Length", obj_desc->buffer.length); | 
|  | 719 | acpi_ex_out_pointer("Pointer", obj_desc->buffer.pointer); | 
|  | 720 | ACPI_DUMP_BUFFER(obj_desc->buffer.pointer, | 
|  | 721 | obj_desc->buffer.length); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 722 | break; | 
|  | 723 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 724 | case ACPI_TYPE_PACKAGE: | 
|  | 725 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 726 | acpi_ex_out_integer("Flags", obj_desc->package.flags); | 
|  | 727 | acpi_ex_out_integer("Elements", obj_desc->package.count); | 
|  | 728 | acpi_ex_out_pointer("Element List", obj_desc->package.elements); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 729 |  | 
|  | 730 | /* Dump the package contents */ | 
|  | 731 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 732 | acpi_os_printf("\nPackage Contents:\n"); | 
|  | 733 | acpi_ex_dump_package(obj_desc, 0, 0); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 734 | break; | 
|  | 735 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 736 | case ACPI_TYPE_DEVICE: | 
|  | 737 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 738 | acpi_ex_out_pointer("Handler", obj_desc->device.handler); | 
|  | 739 | acpi_ex_out_pointer("system_notify", | 
|  | 740 | obj_desc->device.system_notify); | 
|  | 741 | acpi_ex_out_pointer("device_notify", | 
|  | 742 | obj_desc->device.device_notify); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 743 | break; | 
|  | 744 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 745 | case ACPI_TYPE_EVENT: | 
|  | 746 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 747 | acpi_ex_out_pointer("Semaphore", obj_desc->event.semaphore); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 748 | break; | 
|  | 749 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 750 | case ACPI_TYPE_METHOD: | 
|  | 751 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 752 | acpi_ex_out_integer("param_count", | 
|  | 753 | obj_desc->method.param_count); | 
|  | 754 | acpi_ex_out_integer("Concurrency", | 
|  | 755 | obj_desc->method.concurrency); | 
|  | 756 | acpi_ex_out_pointer("Semaphore", obj_desc->method.semaphore); | 
|  | 757 | acpi_ex_out_integer("owner_id", obj_desc->method.owner_id); | 
|  | 758 | acpi_ex_out_integer("aml_length", obj_desc->method.aml_length); | 
|  | 759 | acpi_ex_out_pointer("aml_start", obj_desc->method.aml_start); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 760 | break; | 
|  | 761 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 762 | case ACPI_TYPE_MUTEX: | 
|  | 763 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 764 | acpi_ex_out_integer("sync_level", obj_desc->mutex.sync_level); | 
|  | 765 | acpi_ex_out_pointer("owner_thread", | 
|  | 766 | obj_desc->mutex.owner_thread); | 
|  | 767 | acpi_ex_out_integer("acquire_depth", | 
|  | 768 | obj_desc->mutex.acquisition_depth); | 
|  | 769 | acpi_ex_out_pointer("Semaphore", obj_desc->mutex.semaphore); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 770 | break; | 
|  | 771 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 772 | case ACPI_TYPE_REGION: | 
|  | 773 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 774 | acpi_ex_out_integer("space_id", obj_desc->region.space_id); | 
|  | 775 | acpi_ex_out_integer("Flags", obj_desc->region.flags); | 
|  | 776 | acpi_ex_out_address("Address", obj_desc->region.address); | 
|  | 777 | acpi_ex_out_integer("Length", obj_desc->region.length); | 
|  | 778 | acpi_ex_out_pointer("Handler", obj_desc->region.handler); | 
|  | 779 | acpi_ex_out_pointer("Next", obj_desc->region.next); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 780 | break; | 
|  | 781 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 782 | case ACPI_TYPE_POWER: | 
|  | 783 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 784 | acpi_ex_out_integer("system_level", | 
|  | 785 | obj_desc->power_resource.system_level); | 
|  | 786 | acpi_ex_out_integer("resource_order", | 
|  | 787 | obj_desc->power_resource.resource_order); | 
|  | 788 | acpi_ex_out_pointer("system_notify", | 
|  | 789 | obj_desc->power_resource.system_notify); | 
|  | 790 | acpi_ex_out_pointer("device_notify", | 
|  | 791 | obj_desc->power_resource.device_notify); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 792 | break; | 
|  | 793 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 794 | case ACPI_TYPE_PROCESSOR: | 
|  | 795 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 796 | acpi_ex_out_integer("Processor ID", | 
|  | 797 | obj_desc->processor.proc_id); | 
|  | 798 | acpi_ex_out_integer("Length", obj_desc->processor.length); | 
|  | 799 | acpi_ex_out_address("Address", | 
|  | 800 | (acpi_physical_address) obj_desc->processor. | 
|  | 801 | address); | 
|  | 802 | acpi_ex_out_pointer("system_notify", | 
|  | 803 | obj_desc->processor.system_notify); | 
|  | 804 | acpi_ex_out_pointer("device_notify", | 
|  | 805 | obj_desc->processor.device_notify); | 
|  | 806 | acpi_ex_out_pointer("Handler", obj_desc->processor.handler); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 807 | break; | 
|  | 808 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 809 | case ACPI_TYPE_THERMAL: | 
|  | 810 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 811 | acpi_ex_out_pointer("system_notify", | 
|  | 812 | obj_desc->thermal_zone.system_notify); | 
|  | 813 | acpi_ex_out_pointer("device_notify", | 
|  | 814 | obj_desc->thermal_zone.device_notify); | 
|  | 815 | acpi_ex_out_pointer("Handler", obj_desc->thermal_zone.handler); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 816 | break; | 
|  | 817 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 818 | case ACPI_TYPE_BUFFER_FIELD: | 
|  | 819 | case ACPI_TYPE_LOCAL_REGION_FIELD: | 
|  | 820 | case ACPI_TYPE_LOCAL_BANK_FIELD: | 
|  | 821 | case ACPI_TYPE_LOCAL_INDEX_FIELD: | 
|  | 822 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 823 | acpi_ex_out_integer("field_flags", | 
|  | 824 | obj_desc->common_field.field_flags); | 
|  | 825 | acpi_ex_out_integer("access_byte_width", | 
|  | 826 | obj_desc->common_field.access_byte_width); | 
|  | 827 | acpi_ex_out_integer("bit_length", | 
|  | 828 | obj_desc->common_field.bit_length); | 
|  | 829 | acpi_ex_out_integer("fld_bit_offset", | 
|  | 830 | obj_desc->common_field. | 
|  | 831 | start_field_bit_offset); | 
|  | 832 | acpi_ex_out_integer("base_byte_offset", | 
|  | 833 | obj_desc->common_field.base_byte_offset); | 
|  | 834 | acpi_ex_out_pointer("parent_node", obj_desc->common_field.node); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 835 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 836 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 837 | case ACPI_TYPE_BUFFER_FIELD: | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 838 | acpi_ex_out_pointer("buffer_obj", | 
|  | 839 | obj_desc->buffer_field.buffer_obj); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 840 | break; | 
|  | 841 |  | 
|  | 842 | case ACPI_TYPE_LOCAL_REGION_FIELD: | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 843 | acpi_ex_out_pointer("region_obj", | 
|  | 844 | obj_desc->field.region_obj); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 845 | break; | 
|  | 846 |  | 
|  | 847 | case ACPI_TYPE_LOCAL_BANK_FIELD: | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 848 | acpi_ex_out_integer("Value", | 
|  | 849 | obj_desc->bank_field.value); | 
|  | 850 | acpi_ex_out_pointer("region_obj", | 
|  | 851 | obj_desc->bank_field.region_obj); | 
|  | 852 | acpi_ex_out_pointer("bank_obj", | 
|  | 853 | obj_desc->bank_field.bank_obj); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 854 | break; | 
|  | 855 |  | 
|  | 856 | case ACPI_TYPE_LOCAL_INDEX_FIELD: | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 857 | acpi_ex_out_integer("Value", | 
|  | 858 | obj_desc->index_field.value); | 
|  | 859 | acpi_ex_out_pointer("Index", | 
|  | 860 | obj_desc->index_field.index_obj); | 
|  | 861 | acpi_ex_out_pointer("Data", | 
|  | 862 | obj_desc->index_field.data_obj); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 863 | break; | 
|  | 864 |  | 
|  | 865 | default: | 
|  | 866 | /* All object types covered above */ | 
|  | 867 | break; | 
|  | 868 | } | 
|  | 869 | break; | 
|  | 870 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 871 | case ACPI_TYPE_LOCAL_REFERENCE: | 
|  | 872 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 873 | acpi_ex_out_integer("target_type", | 
|  | 874 | obj_desc->reference.target_type); | 
|  | 875 | acpi_ex_out_string("Opcode", | 
|  | 876 | (acpi_ps_get_opcode_info | 
|  | 877 | (obj_desc->reference.opcode))->name); | 
|  | 878 | acpi_ex_out_integer("Offset", obj_desc->reference.offset); | 
|  | 879 | acpi_ex_out_pointer("obj_desc", obj_desc->reference.object); | 
|  | 880 | acpi_ex_out_pointer("Node", obj_desc->reference.node); | 
|  | 881 | acpi_ex_out_pointer("Where", obj_desc->reference.where); | 
| Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 882 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 883 | acpi_ex_dump_reference(obj_desc); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 884 | break; | 
|  | 885 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | case ACPI_TYPE_LOCAL_ADDRESS_HANDLER: | 
|  | 887 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 888 | acpi_ex_out_integer("space_id", | 
|  | 889 | obj_desc->address_space.space_id); | 
|  | 890 | acpi_ex_out_pointer("Next", obj_desc->address_space.next); | 
|  | 891 | acpi_ex_out_pointer("region_list", | 
|  | 892 | obj_desc->address_space.region_list); | 
|  | 893 | acpi_ex_out_pointer("Node", obj_desc->address_space.node); | 
|  | 894 | acpi_ex_out_pointer("Context", obj_desc->address_space.context); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 895 | break; | 
|  | 896 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 897 | case ACPI_TYPE_LOCAL_NOTIFY: | 
|  | 898 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 899 | acpi_ex_out_pointer("Node", obj_desc->notify.node); | 
|  | 900 | acpi_ex_out_pointer("Context", obj_desc->notify.context); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 901 | break; | 
|  | 902 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 903 | case ACPI_TYPE_LOCAL_ALIAS: | 
|  | 904 | case ACPI_TYPE_LOCAL_METHOD_ALIAS: | 
|  | 905 | case ACPI_TYPE_LOCAL_EXTRA: | 
|  | 906 | case ACPI_TYPE_LOCAL_DATA: | 
|  | 907 | default: | 
|  | 908 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 909 | acpi_os_printf | 
|  | 910 | ("ex_dump_object_descriptor: Display not implemented for object type %s\n", | 
|  | 911 | acpi_ut_get_object_type_name(obj_desc)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 912 | break; | 
|  | 913 | } | 
|  | 914 |  | 
|  | 915 | return_VOID; | 
|  | 916 | } | 
|  | 917 |  | 
| Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 918 | #endif				/*  ACPI_FUTURE_USAGE  */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 919 | #endif |