exdump.c 29.1 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7
/******************************************************************************
 *
 * Module Name: exdump - Interpreter debug output routines
 *
 *****************************************************************************/

/*
L
Len Brown 已提交
8
 * Copyright (C) 2000 - 2008, Intel Corp.
L
Linus Torvalds 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */

#include <acpi/acpi.h>
L
Len Brown 已提交
45 46 47 48
#include "accommon.h"
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
L
Linus Torvalds 已提交
49 50

#define _COMPONENT          ACPI_EXECUTER
L
Len Brown 已提交
51
ACPI_MODULE_NAME("exdump")
L
Linus Torvalds 已提交
52

53 54 55 56
/*
 * The following routines are used for debug output only
 */
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
R
Robert Moore 已提交
57
/* Local prototypes */
L
Len Brown 已提交
58
static void acpi_ex_out_string(char *title, char *value);
R
Robert Moore 已提交
59

L
Len Brown 已提交
60
static void acpi_ex_out_pointer(char *title, void *value);
R
Robert Moore 已提交
61

B
Bob Moore 已提交
62 63 64 65
static void
acpi_ex_dump_object(union acpi_operand_object *obj_desc,
		    struct acpi_exdump_info *info);

B
Bob Moore 已提交
66
static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc);
67 68

static void
B
Bob Moore 已提交
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
			 u32 level, u32 index);

/*******************************************************************************
 *
 * Object Descriptor info tables
 *
 * Note: The first table entry must be an INIT opcode and must contain
 * the table length (number of table entries)
 *
 ******************************************************************************/

static struct acpi_exdump_info acpi_ex_dump_integer[2] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_integer), NULL},
	{ACPI_EXD_UINT64, ACPI_EXD_OFFSET(integer.value), "Value"}
};

static struct acpi_exdump_info acpi_ex_dump_string[4] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_string), NULL},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(string.length), "Length"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(string.pointer), "Pointer"},
	{ACPI_EXD_STRING, 0, NULL}
};

93
static struct acpi_exdump_info acpi_ex_dump_buffer[5] = {
B
Bob Moore 已提交
94 95 96
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer), NULL},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(buffer.length), "Length"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.pointer), "Pointer"},
97
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.node), "Parent Node"},
B
Bob Moore 已提交
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
	{ACPI_EXD_BUFFER, 0, NULL}
};

static struct acpi_exdump_info acpi_ex_dump_package[5] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_package), NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(package.flags), "Flags"},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(package.count), "Elements"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(package.elements), "Element List"},
	{ACPI_EXD_PACKAGE, 0, NULL}
};

static struct acpi_exdump_info acpi_ex_dump_device[4] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.system_notify),
	 "System Notify"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.device_notify),
	 "Device Notify"}
};

static struct acpi_exdump_info acpi_ex_dump_event[2] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL},
B
Bob Moore 已提交
120
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"}
B
Bob Moore 已提交
121 122
};

123
static struct acpi_exdump_info acpi_ex_dump_method[9] = {
B
Bob Moore 已提交
124
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
125 126 127
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.method_flags), "Method Flags"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count),
	 "Parameter Count"},
B
Bob Moore 已提交
128 129
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
B
Bob Moore 已提交
130
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
B
Bob Moore 已提交
131
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
B
Bob Moore 已提交
132 133 134 135 136 137 138
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.aml_start), "Aml Start"}
};

static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_mutex), NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.sync_level), "Sync Level"},
139
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
B
Bob Moore 已提交
140 141
	{ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
	 "Acquire Depth"},
B
Bob Moore 已提交
142
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
B
Bob Moore 已提交
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
};

static struct acpi_exdump_info acpi_ex_dump_region[7] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region), NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(region.space_id), "Space Id"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(region.flags), "Flags"},
	{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(region.address), "Address"},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(region.length), "Length"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(region.handler), "Handler"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(region.next), "Next"}
};

static struct acpi_exdump_info acpi_ex_dump_power[5] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_power), NULL},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.system_level),
	 "System Level"},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order),
	 "Resource Order"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.system_notify),
	 "System Notify"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.device_notify),
	 "Device Notify"}
};

static struct acpi_exdump_info acpi_ex_dump_processor[7] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_processor), NULL},
169 170
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"},
B
Bob Moore 已提交
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
	{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify),
	 "System Notify"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.device_notify),
	 "Device Notify"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"}
};

static struct acpi_exdump_info acpi_ex_dump_thermal[4] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.system_notify),
	 "System Notify"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.device_notify),
	 "Device Notify"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"}
};

static struct acpi_exdump_info acpi_ex_dump_buffer_field[3] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer_field), NULL},
	{ACPI_EXD_FIELD, 0, NULL},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer_field.buffer_obj),
	 "Buffer Object"}
};

static struct acpi_exdump_info acpi_ex_dump_region_field[3] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region_field), NULL},
	{ACPI_EXD_FIELD, 0, NULL},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.region_obj), "Region Object"}
};

static struct acpi_exdump_info acpi_ex_dump_bank_field[5] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_bank_field), NULL},
	{ACPI_EXD_FIELD, 0, NULL},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(bank_field.value), "Value"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(bank_field.region_obj),
	 "Region Object"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(bank_field.bank_obj), "Bank Object"}
};

static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_bank_field), NULL},
	{ACPI_EXD_FIELD, 0, NULL},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(index_field.value), "Value"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.index_obj),
	 "Index Object"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"}
};

219
static struct acpi_exdump_info acpi_ex_dump_reference[8] = {
B
Bob Moore 已提交
220
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
221
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.class), "Class"},
B
Bob Moore 已提交
222
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
223
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"},
B
Bob Moore 已提交
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
	{ACPI_EXD_REFERENCE, 0, NULL}
};

static struct acpi_exdump_info acpi_ex_dump_address_handler[6] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_address_handler),
	 NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(address_space.space_id), "Space Id"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.next), "Next"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.region_list),
	 "Region List"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.node), "Node"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"}
};

static struct acpi_exdump_info acpi_ex_dump_notify[3] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"}
};

/* Miscellaneous tables */

static struct acpi_exdump_info acpi_ex_dump_common[4] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_common), NULL},
	{ACPI_EXD_TYPE, 0, NULL},
	{ACPI_EXD_UINT16, ACPI_EXD_OFFSET(common.reference_count),
	 "Reference Count"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common.flags), "Flags"}
};

static struct acpi_exdump_info acpi_ex_dump_field_common[7] = {
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_field_common), NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.field_flags),
	 "Field Flags"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.access_byte_width),
	 "Access Byte Width"},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(common_field.bit_length),
	 "Bit Length"},
	{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.start_field_bit_offset),
	 "Field Bit Offset"},
	{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(common_field.base_byte_offset),
	 "Base Byte Offset"},
	{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(common_field.node), "Parent Node"}
};

B
Bob Moore 已提交
272
static struct acpi_exdump_info acpi_ex_dump_node[5] = {
B
Bob Moore 已提交
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
	{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL},
	{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
	{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
	{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(child), "Child List"},
	{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(peer), "Next Peer"}
};

/* Dispatch table, indexed by object type */

static struct acpi_exdump_info *acpi_ex_dump_info[] = {
	NULL,
	acpi_ex_dump_integer,
	acpi_ex_dump_string,
	acpi_ex_dump_buffer,
	acpi_ex_dump_package,
	NULL,
	acpi_ex_dump_device,
	acpi_ex_dump_event,
	acpi_ex_dump_method,
	acpi_ex_dump_mutex,
	acpi_ex_dump_region,
	acpi_ex_dump_power,
	acpi_ex_dump_processor,
	acpi_ex_dump_thermal,
	acpi_ex_dump_buffer_field,
	NULL,
	NULL,
	acpi_ex_dump_region_field,
	acpi_ex_dump_bank_field,
	acpi_ex_dump_index_field,
	acpi_ex_dump_reference,
	NULL,
	NULL,
	acpi_ex_dump_notify,
	acpi_ex_dump_address_handler,
	NULL,
	NULL,
	NULL
};

/*******************************************************************************
 *
 * FUNCTION:    acpi_ex_dump_object
 *
 * PARAMETERS:  obj_desc            - Descriptor to dump
 *              Info                - Info table corresponding to this object
 *                                    type
 *
 * RETURN:      None
 *
 * DESCRIPTION: Walk the info table for this object
 *
 ******************************************************************************/

static void
acpi_ex_dump_object(union acpi_operand_object *obj_desc,
		    struct acpi_exdump_info *info)
{
	u8 *target;
	char *name;
	u8 count;

	if (!info) {
		acpi_os_printf
B
Bob Moore 已提交
337
		    ("ExDumpObject: Display not implemented for object type %s\n",
B
Bob Moore 已提交
338 339 340 341 342 343 344 345 346
		     acpi_ut_get_object_type_name(obj_desc));
		return;
	}

	/* First table entry must contain the table length (# of table entries) */

	count = info->offset;

	while (count) {
B
Bob Moore 已提交
347
		target = ACPI_ADD_PTR(u8, obj_desc, info->offset);
B
Bob Moore 已提交
348 349 350 351 352 353 354
		name = info->name;

		switch (info->opcode) {
		case ACPI_EXD_INIT:
			break;

		case ACPI_EXD_TYPE:
355

B
Bob Moore 已提交
356 357 358 359 360 361 362 363 364 365 366 367 368
			acpi_ex_out_string("Type",
					   acpi_ut_get_object_type_name
					   (obj_desc));
			break;

		case ACPI_EXD_UINT8:

			acpi_os_printf("%20s : %2.2X\n", name, *target);
			break;

		case ACPI_EXD_UINT16:

			acpi_os_printf("%20s : %4.4X\n", name,
B
Bob Moore 已提交
369
				       ACPI_GET16(target));
B
Bob Moore 已提交
370 371 372 373 374
			break;

		case ACPI_EXD_UINT32:

			acpi_os_printf("%20s : %8.8X\n", name,
B
Bob Moore 已提交
375
				       ACPI_GET32(target));
B
Bob Moore 已提交
376 377 378 379 380
			break;

		case ACPI_EXD_UINT64:

			acpi_os_printf("%20s : %8.8X%8.8X\n", "Value",
B
Bob Moore 已提交
381
				       ACPI_FORMAT_UINT64(ACPI_GET64(target)));
B
Bob Moore 已提交
382 383 384
			break;

		case ACPI_EXD_POINTER:
385
		case ACPI_EXD_ADDRESS:
B
Bob Moore 已提交
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419

			acpi_ex_out_pointer(name,
					    *ACPI_CAST_PTR(void *, target));
			break;

		case ACPI_EXD_STRING:

			acpi_ut_print_string(obj_desc->string.pointer,
					     ACPI_UINT8_MAX);
			acpi_os_printf("\n");
			break;

		case ACPI_EXD_BUFFER:

			ACPI_DUMP_BUFFER(obj_desc->buffer.pointer,
					 obj_desc->buffer.length);
			break;

		case ACPI_EXD_PACKAGE:

			/* Dump the package contents */

			acpi_os_printf("\nPackage Contents:\n");
			acpi_ex_dump_package_obj(obj_desc, 0, 0);
			break;

		case ACPI_EXD_FIELD:

			acpi_ex_dump_object(obj_desc,
					    acpi_ex_dump_field_common);
			break;

		case ACPI_EXD_REFERENCE:

420
			acpi_ex_out_string("Class Name",
421 422 423
					   ACPI_CAST_PTR(char,
							 acpi_ut_get_reference_name
							 (obj_desc)));
B
Bob Moore 已提交
424 425 426 427
			acpi_ex_dump_reference_obj(obj_desc);
			break;

		default:
428

B
Bob Moore 已提交
429 430 431 432 433 434 435 436 437
			acpi_os_printf("**** Invalid table opcode [%X] ****\n",
				       info->opcode);
			return;
		}

		info++;
		count--;
	}
}
L
Linus Torvalds 已提交
438

R
Robert Moore 已提交
439
/*******************************************************************************
L
Linus Torvalds 已提交
440 441 442
 *
 * FUNCTION:    acpi_ex_dump_operand
 *
R
Robert Moore 已提交
443 444
 * PARAMETERS:  *obj_desc       - Pointer to entry to be dumped
 *              Depth           - Current nesting depth
L
Linus Torvalds 已提交
445 446 447 448 449
 *
 * RETURN:      None
 *
 * DESCRIPTION: Dump an operand object
 *
R
Robert Moore 已提交
450
 ******************************************************************************/
L
Linus Torvalds 已提交
451

L
Len Brown 已提交
452
void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
L
Linus Torvalds 已提交
453
{
L
Len Brown 已提交
454 455
	u32 length;
	u32 index;
L
Linus Torvalds 已提交
456

B
Bob Moore 已提交
457
	ACPI_FUNCTION_NAME(ex_dump_operand)
L
Linus Torvalds 已提交
458

L
Len Brown 已提交
459 460
	    if (!((ACPI_LV_EXEC & acpi_dbg_level)
		  && (_COMPONENT & acpi_dbg_layer))) {
L
Linus Torvalds 已提交
461 462 463 464
		return;
	}

	if (!obj_desc) {
B
Bob Moore 已提交
465

R
Robert Moore 已提交
466 467
		/* This could be a null element of a package */

L
Len Brown 已提交
468
		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
L
Linus Torvalds 已提交
469 470 471
		return;
	}

L
Len Brown 已提交
472 473 474 475
	if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Namespace Node: ",
				  obj_desc));
		ACPI_DUMP_ENTRY(obj_desc, ACPI_LV_EXEC);
L
Linus Torvalds 已提交
476 477 478
		return;
	}

L
Len Brown 已提交
479 480 481 482 483 484
	if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
				  "%p is not a node or operand object: [%s]\n",
				  obj_desc,
				  acpi_ut_get_descriptor_name(obj_desc)));
		ACPI_DUMP_BUFFER(obj_desc, sizeof(union acpi_operand_object));
L
Linus Torvalds 已提交
485 486 487 488 489 490
		return;
	}

	/* obj_desc is a valid object */

	if (depth > 0) {
L
Len Brown 已提交
491 492 493 494
		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ",
				  depth, " ", depth, obj_desc));
	} else {
		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc));
L
Linus Torvalds 已提交
495 496
	}

R
Robert Moore 已提交
497 498
	/* Decode object type */

499
	switch (obj_desc->common.type) {
L
Linus Torvalds 已提交
500 501
	case ACPI_TYPE_LOCAL_REFERENCE:

502 503 504 505 506
		acpi_os_printf("Reference: [%s] ",
			       acpi_ut_get_reference_name(obj_desc));

		switch (obj_desc->reference.class) {
		case ACPI_REFCLASS_DEBUG:
L
Linus Torvalds 已提交
507

508
			acpi_os_printf("\n");
L
Linus Torvalds 已提交
509 510
			break;

511
		case ACPI_REFCLASS_INDEX:
L
Linus Torvalds 已提交
512

513
			acpi_os_printf("%p\n", obj_desc->reference.object);
L
Linus Torvalds 已提交
514 515
			break;

516
		case ACPI_REFCLASS_TABLE:
517

518
			acpi_os_printf("Table Index %X\n",
519
				       obj_desc->reference.value);
520 521
			break;

522
		case ACPI_REFCLASS_REFOF:
L
Linus Torvalds 已提交
523

524
			acpi_os_printf("%p [%s]\n", obj_desc->reference.object,
B
Bob Moore 已提交
525 526
				       acpi_ut_get_type_name(((union
							       acpi_operand_object
527 528
							       *)
							      obj_desc->
B
Bob Moore 已提交
529 530 531
							      reference.
							      object)->common.
							     type));
L
Linus Torvalds 已提交
532 533
			break;

534
		case ACPI_REFCLASS_NAME:
L
Linus Torvalds 已提交
535

536 537
			acpi_os_printf("- [%4.4s]\n",
				       obj_desc->reference.node->name.ascii);
L
Linus Torvalds 已提交
538 539
			break;

540
		case ACPI_REFCLASS_ARG:
541
		case ACPI_REFCLASS_LOCAL:
L
Linus Torvalds 已提交
542

543
			acpi_os_printf("%X\n", obj_desc->reference.value);
L
Linus Torvalds 已提交
544 545
			break;

546
		default:	/* Unknown reference class */
L
Linus Torvalds 已提交
547

548
			acpi_os_printf("%2.2X\n", obj_desc->reference.class);
L
Linus Torvalds 已提交
549 550 551 552 553 554
			break;
		}
		break;

	case ACPI_TYPE_BUFFER:

555
		acpi_os_printf("Buffer length %.2X @ %p\n",
L
Len Brown 已提交
556 557
			       obj_desc->buffer.length,
			       obj_desc->buffer.pointer);
L
Linus Torvalds 已提交
558 559 560 561

		/* Debug only -- dump the buffer contents */

		if (obj_desc->buffer.pointer) {
562 563 564
			length = obj_desc->buffer.length;
			if (length > 128) {
				length = 128;
L
Linus Torvalds 已提交
565
			}
566 567 568 569 570

			acpi_os_printf
			    ("Buffer Contents: (displaying length 0x%.2X)\n",
			     length);
			ACPI_DUMP_BUFFER(obj_desc->buffer.pointer, length);
L
Linus Torvalds 已提交
571 572 573 574 575
		}
		break;

	case ACPI_TYPE_INTEGER:

L
Len Brown 已提交
576 577
		acpi_os_printf("Integer %8.8X%8.8X\n",
			       ACPI_FORMAT_UINT64(obj_desc->integer.value));
L
Linus Torvalds 已提交
578 579 580 581
		break;

	case ACPI_TYPE_PACKAGE:

B
Bob Moore 已提交
582
		acpi_os_printf("Package [Len %X] ElementArray %p\n",
L
Len Brown 已提交
583 584
			       obj_desc->package.count,
			       obj_desc->package.elements);
L
Linus Torvalds 已提交
585 586 587 588 589 590

		/*
		 * If elements exist, package element pointer is valid,
		 * and debug_level exceeds 1, dump package's elements.
		 */
		if (obj_desc->package.count &&
L
Len Brown 已提交
591 592 593 594 595 596
		    obj_desc->package.elements && acpi_dbg_level > 1) {
			for (index = 0; index < obj_desc->package.count;
			     index++) {
				acpi_ex_dump_operand(obj_desc->package.
						     elements[index],
						     depth + 1);
L
Linus Torvalds 已提交
597 598 599 600 601 602
			}
		}
		break;

	case ACPI_TYPE_REGION:

L
Len Brown 已提交
603 604 605 606
		acpi_os_printf("Region %s (%X)",
			       acpi_ut_get_region_name(obj_desc->region.
						       space_id),
			       obj_desc->region.space_id);
L
Linus Torvalds 已提交
607 608 609 610 611 612

		/*
		 * If the address and length have not been evaluated,
		 * don't print them.
		 */
		if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) {
L
Len Brown 已提交
613 614 615
			acpi_os_printf("\n");
		} else {
			acpi_os_printf(" base %8.8X%8.8X Length %X\n",
616 617
				       ACPI_FORMAT_NATIVE_UINT(obj_desc->region.
							       address),
L
Len Brown 已提交
618
				       obj_desc->region.length);
L
Linus Torvalds 已提交
619 620 621 622 623
		}
		break;

	case ACPI_TYPE_STRING:

L
Len Brown 已提交
624 625 626
		acpi_os_printf("String length %X @ %p ",
			       obj_desc->string.length,
			       obj_desc->string.pointer);
R
Robert Moore 已提交
627

L
Len Brown 已提交
628 629
		acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
		acpi_os_printf("\n");
L
Linus Torvalds 已提交
630 631 632 633
		break;

	case ACPI_TYPE_LOCAL_BANK_FIELD:

B
Bob Moore 已提交
634
		acpi_os_printf("BankField\n");
L
Linus Torvalds 已提交
635 636 637 638
		break;

	case ACPI_TYPE_LOCAL_REGION_FIELD:

L
Len Brown 已提交
639
		acpi_os_printf
640 641
		    ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
		     "byte=%X bit=%X of below:\n", obj_desc->field.bit_length,
L
Len Brown 已提交
642 643 644 645 646
		     obj_desc->field.access_byte_width,
		     obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
		     obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
		     obj_desc->field.base_byte_offset,
		     obj_desc->field.start_field_bit_offset);
R
Robert Moore 已提交
647

L
Len Brown 已提交
648
		acpi_ex_dump_operand(obj_desc->field.region_obj, depth + 1);
L
Linus Torvalds 已提交
649 650 651 652
		break;

	case ACPI_TYPE_LOCAL_INDEX_FIELD:

B
Bob Moore 已提交
653
		acpi_os_printf("IndexField\n");
L
Linus Torvalds 已提交
654 655 656 657
		break;

	case ACPI_TYPE_BUFFER_FIELD:

B
Bob Moore 已提交
658
		acpi_os_printf("BufferField: %X bits at byte %X bit %X of\n",
L
Len Brown 已提交
659 660 661
			       obj_desc->buffer_field.bit_length,
			       obj_desc->buffer_field.base_byte_offset,
			       obj_desc->buffer_field.start_field_bit_offset);
L
Linus Torvalds 已提交
662 663

		if (!obj_desc->buffer_field.buffer_obj) {
B
Bob Moore 已提交
664
			ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n"));
665 666
		} else if ((obj_desc->buffer_field.buffer_obj)->common.type !=
			   ACPI_TYPE_BUFFER) {
B
Bob Moore 已提交
667
			acpi_os_printf("*not a Buffer*\n");
L
Len Brown 已提交
668 669 670
		} else {
			acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj,
					     depth + 1);
L
Linus Torvalds 已提交
671 672 673 674 675
		}
		break;

	case ACPI_TYPE_EVENT:

L
Len Brown 已提交
676
		acpi_os_printf("Event\n");
L
Linus Torvalds 已提交
677 678 679 680
		break;

	case ACPI_TYPE_METHOD:

L
Len Brown 已提交
681 682 683 684
		acpi_os_printf("Method(%X) @ %p:%X\n",
			       obj_desc->method.param_count,
			       obj_desc->method.aml_start,
			       obj_desc->method.aml_length);
L
Linus Torvalds 已提交
685 686 687 688
		break;

	case ACPI_TYPE_MUTEX:

L
Len Brown 已提交
689
		acpi_os_printf("Mutex\n");
L
Linus Torvalds 已提交
690 691 692 693
		break;

	case ACPI_TYPE_DEVICE:

L
Len Brown 已提交
694
		acpi_os_printf("Device\n");
L
Linus Torvalds 已提交
695 696 697 698
		break;

	case ACPI_TYPE_POWER:

L
Len Brown 已提交
699
		acpi_os_printf("Power\n");
L
Linus Torvalds 已提交
700 701 702 703
		break;

	case ACPI_TYPE_PROCESSOR:

L
Len Brown 已提交
704
		acpi_os_printf("Processor\n");
L
Linus Torvalds 已提交
705 706 707 708
		break;

	case ACPI_TYPE_THERMAL:

L
Len Brown 已提交
709
		acpi_os_printf("Thermal\n");
L
Linus Torvalds 已提交
710 711 712 713 714
		break;

	default:
		/* Unknown Type */

715
		acpi_os_printf("Unknown Type %X\n", obj_desc->common.type);
L
Linus Torvalds 已提交
716 717 718 719 720 721
		break;
	}

	return;
}

R
Robert Moore 已提交
722
/*******************************************************************************
L
Linus Torvalds 已提交
723 724 725
 *
 * FUNCTION:    acpi_ex_dump_operands
 *
726 727 728
 * PARAMETERS:	Operands	    - A list of Operand objects
 *		opcode_name	    - AML opcode name
 *		num_operands	    - Operand count for this opcode
L
Linus Torvalds 已提交
729
 *
730
 * DESCRIPTION: Dump the operands associated with the opcode
L
Linus Torvalds 已提交
731
 *
R
Robert Moore 已提交
732
 ******************************************************************************/
L
Linus Torvalds 已提交
733 734

void
L
Len Brown 已提交
735
acpi_ex_dump_operands(union acpi_operand_object **operands,
736
		      const char *opcode_name, u32 num_operands)
L
Linus Torvalds 已提交
737
{
B
Bob Moore 已提交
738
	ACPI_FUNCTION_NAME(ex_dump_operands);
L
Linus Torvalds 已提交
739

740 741
	if (!opcode_name) {
		opcode_name = "UNKNOWN";
L
Linus Torvalds 已提交
742 743
	}

L
Len Brown 已提交
744
	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
745 746
			  "**** Start operand dump for opcode [%s], %d operands\n",
			  opcode_name, num_operands));
L
Linus Torvalds 已提交
747

748 749
	if (num_operands == 0) {
		num_operands = 1;
L
Linus Torvalds 已提交
750 751
	}

752
	/* Dump the individual operands */
L
Linus Torvalds 已提交
753

754 755 756 757
	while (num_operands) {
		acpi_ex_dump_operand(*operands, 0);
		operands++;
		num_operands--;
L
Linus Torvalds 已提交
758 759
	}

L
Len Brown 已提交
760
	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
761
			  "**** End operand dump for [%s]\n", opcode_name));
L
Linus Torvalds 已提交
762 763 764
	return;
}

R
Robert Moore 已提交
765
/*******************************************************************************
L
Linus Torvalds 已提交
766
 *
R
Robert Moore 已提交
767
 * FUNCTION:    acpi_ex_out* functions
L
Linus Torvalds 已提交
768 769 770 771 772 773 774 775
 *
 * PARAMETERS:  Title               - Descriptive text
 *              Value               - Value to be displayed
 *
 * DESCRIPTION: Object dump output formatting functions.  These functions
 *              reduce the number of format strings required and keeps them
 *              all in one place for easy modification.
 *
R
Robert Moore 已提交
776
 ******************************************************************************/
L
Linus Torvalds 已提交
777

L
Len Brown 已提交
778
static void acpi_ex_out_string(char *title, char *value)
L
Linus Torvalds 已提交
779
{
L
Len Brown 已提交
780
	acpi_os_printf("%20s : %s\n", title, value);
L
Linus Torvalds 已提交
781 782
}

L
Len Brown 已提交
783
static void acpi_ex_out_pointer(char *title, void *value)
L
Linus Torvalds 已提交
784
{
L
Len Brown 已提交
785
	acpi_os_printf("%20s : %p\n", title, value);
L
Linus Torvalds 已提交
786 787
}

R
Robert Moore 已提交
788
/*******************************************************************************
L
Linus Torvalds 已提交
789
 *
B
Bob Moore 已提交
790
 * FUNCTION:    acpi_ex_dump_namespace_node
L
Linus Torvalds 已提交
791
 *
B
Bob Moore 已提交
792
 * PARAMETERS:  Node                - Descriptor to dump
R
Robert Moore 已提交
793
 *              Flags               - Force display if TRUE
L
Linus Torvalds 已提交
794 795 796
 *
 * DESCRIPTION: Dumps the members of the given.Node
 *
R
Robert Moore 已提交
797
 ******************************************************************************/
L
Linus Torvalds 已提交
798

B
Bob Moore 已提交
799
void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
L
Linus Torvalds 已提交
800 801
{

L
Len Brown 已提交
802
	ACPI_FUNCTION_ENTRY();
L
Linus Torvalds 已提交
803 804

	if (!flags) {
L
Len Brown 已提交
805 806
		if (!((ACPI_LV_OBJECTS & acpi_dbg_level)
		      && (_COMPONENT & acpi_dbg_layer))) {
L
Linus Torvalds 已提交
807 808 809 810
			return;
		}
	}

L
Len Brown 已提交
811 812 813 814 815
	acpi_os_printf("%20s : %4.4s\n", "Name", acpi_ut_get_node_name(node));
	acpi_ex_out_string("Type", acpi_ut_get_type_name(node->type));
	acpi_ex_out_pointer("Attached Object",
			    acpi_ns_get_attached_object(node));
	acpi_ex_out_pointer("Parent", acpi_ns_get_parent_node(node));
B
Bob Moore 已提交
816 817 818

	acpi_ex_dump_object(ACPI_CAST_PTR(union acpi_operand_object, node),
			    acpi_ex_dump_node);
L
Linus Torvalds 已提交
819 820
}

821 822
/*******************************************************************************
 *
B
Bob Moore 已提交
823
 * FUNCTION:    acpi_ex_dump_reference_obj
824 825 826 827 828 829 830
 *
 * PARAMETERS:  Object              - Descriptor to dump
 *
 * DESCRIPTION: Dumps a reference object
 *
 ******************************************************************************/

B
Bob Moore 已提交
831
static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
832
{
L
Len Brown 已提交
833 834
	struct acpi_buffer ret_buf;
	acpi_status status;
835

B
Bob Moore 已提交
836 837
	ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;

838 839
	if (obj_desc->reference.class == ACPI_REFCLASS_NAME) {
		acpi_os_printf(" %p ", obj_desc->reference.node);
B
Bob Moore 已提交
840

L
Len Brown 已提交
841 842 843 844
		status =
		    acpi_ns_handle_to_pathname(obj_desc->reference.node,
					       &ret_buf);
		if (ACPI_FAILURE(status)) {
B
Bob Moore 已提交
845
			acpi_os_printf(" Could not convert name to pathname\n");
L
Len Brown 已提交
846 847
		} else {
			acpi_os_printf("%s\n", (char *)ret_buf.pointer);
B
Bob Moore 已提交
848
			ACPI_FREE(ret_buf.pointer);
849
		}
L
Len Brown 已提交
850
	} else if (obj_desc->reference.object) {
B
Bob Moore 已提交
851 852
		if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
		    ACPI_DESC_TYPE_OPERAND) {
853 854
			acpi_os_printf(" Target: %p",
				       obj_desc->reference.object);
855 856
			if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
				acpi_os_printf(" Table Index: %X\n",
857
					       obj_desc->reference.value);
858
			} else {
859 860
				acpi_os_printf(" Target: %p [%s]\n",
					       obj_desc->reference.object,
861 862 863 864 865 866 867 868 869
					       acpi_ut_get_type_name(((union
								       acpi_operand_object
								       *)
								      obj_desc->
								      reference.
								      object)->
								     common.
								     type));
			}
B
Bob Moore 已提交
870 871 872 873
		} else {
			acpi_os_printf(" Target: %p\n",
				       obj_desc->reference.object);
		}
874 875 876 877 878
	}
}

/*******************************************************************************
 *
B
Bob Moore 已提交
879
 * FUNCTION:    acpi_ex_dump_package_obj
880
 *
B
Bob Moore 已提交
881
 * PARAMETERS:  obj_desc            - Descriptor to dump
882 883 884 885 886 887 888 889
 *              Level               - Indentation Level
 *              Index               - Package index for this object
 *
 * DESCRIPTION: Dumps the elements of the package
 *
 ******************************************************************************/

static void
B
Bob Moore 已提交
890 891
acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
			 u32 level, u32 index)
892
{
L
Len Brown 已提交
893
	u32 i;
894 895 896 897 898

	/* Indentation and index output */

	if (level > 0) {
		for (i = 0; i < level; i++) {
L
Len Brown 已提交
899
			acpi_os_printf(" ");
900 901
		}

L
Len Brown 已提交
902
		acpi_os_printf("[%.2d] ", index);
903 904
	}

L
Len Brown 已提交
905
	acpi_os_printf("%p ", obj_desc);
906 907 908 909

	/* Null package elements are allowed */

	if (!obj_desc) {
L
Len Brown 已提交
910
		acpi_os_printf("[Null Object]\n");
911 912 913 914 915
		return;
	}

	/* Packages may only contain a few object types */

916
	switch (obj_desc->common.type) {
917 918
	case ACPI_TYPE_INTEGER:

L
Len Brown 已提交
919 920
		acpi_os_printf("[Integer] = %8.8X%8.8X\n",
			       ACPI_FORMAT_UINT64(obj_desc->integer.value));
921 922 923 924
		break;

	case ACPI_TYPE_STRING:

L
Len Brown 已提交
925
		acpi_os_printf("[String] Value: ");
926
		for (i = 0; i < obj_desc->string.length; i++) {
L
Len Brown 已提交
927
			acpi_os_printf("%c", obj_desc->string.pointer[i]);
928
		}
L
Len Brown 已提交
929
		acpi_os_printf("\n");
930 931 932 933
		break;

	case ACPI_TYPE_BUFFER:

L
Len Brown 已提交
934 935
		acpi_os_printf("[Buffer] Length %.2X = ",
			       obj_desc->buffer.length);
936
		if (obj_desc->buffer.length) {
B
Bob Moore 已提交
937 938
			acpi_ut_dump_buffer(ACPI_CAST_PTR
					    (u8, obj_desc->buffer.pointer),
L
Len Brown 已提交
939 940 941 942
					    obj_desc->buffer.length,
					    DB_DWORD_DISPLAY, _COMPONENT);
		} else {
			acpi_os_printf("\n");
943 944 945 946 947
		}
		break;

	case ACPI_TYPE_PACKAGE:

B
Bob Moore 已提交
948
		acpi_os_printf("[Package] Contains %d Elements:\n",
L
Len Brown 已提交
949
			       obj_desc->package.count);
950 951

		for (i = 0; i < obj_desc->package.count; i++) {
B
Bob Moore 已提交
952 953
			acpi_ex_dump_package_obj(obj_desc->package.elements[i],
						 level + 1, i);
954 955 956 957 958
		}
		break;

	case ACPI_TYPE_LOCAL_REFERENCE:

959 960 961
		acpi_os_printf("[Object Reference] Type [%s] %2.2X",
			       acpi_ut_get_reference_name(obj_desc),
			       obj_desc->reference.class);
B
Bob Moore 已提交
962
		acpi_ex_dump_reference_obj(obj_desc);
963 964 965 966
		break;

	default:

967
		acpi_os_printf("[Unknown Type] %X\n", obj_desc->common.type);
968 969 970 971
		break;
	}
}

R
Robert Moore 已提交
972
/*******************************************************************************
L
Linus Torvalds 已提交
973 974 975
 *
 * FUNCTION:    acpi_ex_dump_object_descriptor
 *
B
Bob Moore 已提交
976
 * PARAMETERS:  obj_desc            - Descriptor to dump
R
Robert Moore 已提交
977
 *              Flags               - Force display if TRUE
L
Linus Torvalds 已提交
978 979 980
 *
 * DESCRIPTION: Dumps the members of the object descriptor given.
 *
R
Robert Moore 已提交
981
 ******************************************************************************/
L
Linus Torvalds 已提交
982 983

void
L
Len Brown 已提交
984
acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
L
Linus Torvalds 已提交
985
{
B
Bob Moore 已提交
986
	ACPI_FUNCTION_TRACE(ex_dump_object_descriptor);
L
Linus Torvalds 已提交
987

R
Robert Moore 已提交
988 989 990 991
	if (!obj_desc) {
		return_VOID;
	}

L
Linus Torvalds 已提交
992
	if (!flags) {
L
Len Brown 已提交
993 994
		if (!((ACPI_LV_OBJECTS & acpi_dbg_level)
		      && (_COMPONENT & acpi_dbg_layer))) {
L
Linus Torvalds 已提交
995 996 997 998
			return_VOID;
		}
	}

L
Len Brown 已提交
999
	if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
B
Bob Moore 已提交
1000 1001 1002
		acpi_ex_dump_namespace_node((struct acpi_namespace_node *)
					    obj_desc, flags);

L
Len Brown 已提交
1003 1004 1005
		acpi_os_printf("\nAttached Object (%p):\n",
			       ((struct acpi_namespace_node *)obj_desc)->
			       object);
B
Bob Moore 已提交
1006

L
Len Brown 已提交
1007 1008
		acpi_ex_dump_object_descriptor(((struct acpi_namespace_node *)
						obj_desc)->object, flags);
L
Linus Torvalds 已提交
1009 1010 1011
		return_VOID;
	}

L
Len Brown 已提交
1012 1013
	if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
		acpi_os_printf
B
Bob Moore 已提交
1014
		    ("ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n",
L
Len Brown 已提交
1015
		     obj_desc, acpi_ut_get_descriptor_name(obj_desc));
L
Linus Torvalds 已提交
1016 1017 1018
		return_VOID;
	}

B
Bob Moore 已提交
1019 1020 1021
	if (obj_desc->common.type > ACPI_TYPE_NS_NODE_MAX) {
		return_VOID;
	}
L
Linus Torvalds 已提交
1022

B
Bob Moore 已提交
1023
	/* Common Fields */
L
Linus Torvalds 已提交
1024

B
Bob Moore 已提交
1025
	acpi_ex_dump_object(obj_desc, acpi_ex_dump_common);
L
Linus Torvalds 已提交
1026

B
Bob Moore 已提交
1027
	/* Object-specific fields */
L
Linus Torvalds 已提交
1028

B
Bob Moore 已提交
1029
	acpi_ex_dump_object(obj_desc, acpi_ex_dump_info[obj_desc->common.type]);
L
Linus Torvalds 已提交
1030 1031 1032 1033
	return_VOID;
}

#endif