Deleted Added
sdiff udiff text old ( 85756 ) new ( 87031 )
full compact
1/******************************************************************************
2 *
3 * Module Name: nsdump - table dumping routines for debug
4 * $Revision: 105 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

--- 109 unchanged lines hidden (view full) ---

122#include "acnamesp.h"
123#include "actables.h"
124#include "acparser.h"
125
126
127#define _COMPONENT ACPI_NAMESPACE
128 MODULE_NAME ("nsdump")
129
130
131#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
132
133/*******************************************************************************
134 *
135 * FUNCTION: AcpiNsDumpPathname
136 *
137 * PARAMETERS: Handle - Object
138 * Msg - Prefix message
139 * Level - Desired debug level
140 * Component - Caller's component ID
141 *
142 * DESCRIPTION: Print an object's full namespace pathname

--- 28 unchanged lines hidden (view full) ---

171 return_ACPI_STATUS (AE_NO_MEMORY);
172 }
173
174 /* Convert handle to a full pathname and print it (with supplied message) */
175
176 Length = PATHNAME_MAX;
177 if (ACPI_SUCCESS (AcpiNsHandleToPathname (Handle, &Length, Buffer)))
178 {
179 AcpiOsPrintf ("%s %s (%p)\n", Msg, Buffer, Handle);
180 }
181
182 ACPI_MEM_FREE (Buffer);
183
184 return_ACPI_STATUS (AE_OK);
185}
186
187

--- 39 unchanged lines hidden (view full) ---

227 WhichBit = 1;
228
229
230 if (!(AcpiDbgLevel & Info->DebugLevel))
231 {
232 return (AE_OK);
233 }
234
235 if (!ObjHandle)
236 {
237 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
238 return (AE_OK);
239 }
240
241 /* Check if the owner matches */
242
243 if ((Info->OwnerId != ACPI_UINT32_MAX) &&
244 (Info->OwnerId != ThisNode->OwnerId))
245 {
246 return (AE_OK);
247 }
248
249
250 /* Indent the object according to the level */
251
252 while (LevelTmp--)
253 {
254
255 /* Print appropriate characters to form tree structure */
256
257 if (LevelTmp)
258 {
259 if (DownstreamSiblingMask & WhichBit)
260 {
261 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "|"));
262 }
263
264 else
265 {
266 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " "));
267 }
268
269 WhichBit <<= 1;
270 }
271
272 else
273 {
274 if (AcpiNsExistDownstreamSibling (ThisNode + 1))
275 {
276 DownstreamSiblingMask |= (1 << (Level - 1));
277 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+"));
278 }
279
280 else
281 {
282 DownstreamSiblingMask &= ACPI_UINT32_MAX ^ (1 << (Level - 1));
283 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+"));
284 }
285
286 if (ThisNode->Child == NULL)
287 {
288 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-"));
289 }
290
291 else if (AcpiNsExistDownstreamSibling (ThisNode->Child))
292 {
293 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+"));
294 }
295
296 else
297 {
298 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-"));
299 }
300 }
301 }
302
303
304 /* Check the integrity of our data */
305
306 if (Type > INTERNAL_TYPE_MAX)
307 {
308 Type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */
309 }
310
311 if (!AcpiUtValidAcpiName (ThisNode->Name))
312 {
313 REPORT_WARNING (("Invalid ACPI Name %08X\n", ThisNode->Name));
314 }
315
316 /*
317 * Now we can print out the pertinent information
318 */
319 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-12s %p",
320 (char*)&ThisNode->Name, AcpiUtGetTypeName (Type), ThisNode));
321
322 ObjDesc = ThisNode->Object;
323
324 switch (Info->DisplayType)
325 {
326 case ACPI_DISPLAY_SUMMARY:
327
328 if (!ObjDesc)
329 {
330 /* No attached object, we are done */
331
332 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
333 return (AE_OK);
334 }
335
336
337 switch (Type)
338 {
339 case ACPI_TYPE_PROCESSOR:
340 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ID %d Addr %.4X Len %.4X\n",
341 ObjDesc->Processor.ProcId,
342 ObjDesc->Processor.Address,
343 ObjDesc->Processor.Length));
344 break;
345
346 case ACPI_TYPE_DEVICE:
347 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Notification object: %p", ObjDesc));
348 break;
349
350 case ACPI_TYPE_METHOD:
351 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Args %d Len %.4X Aml %p \n",
352 ObjDesc->Method.ParamCount,
353 ObjDesc->Method.AmlLength,
354 ObjDesc->Method.AmlStart));
355 break;
356
357 case ACPI_TYPE_INTEGER:
358 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = %8.8X%8.8X\n",
359 HIDWORD (ObjDesc->Integer.Value),
360 LODWORD (ObjDesc->Integer.Value)));
361 break;
362
363 case ACPI_TYPE_PACKAGE:
364 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Elements %.2X\n",
365 ObjDesc->Package.Count));
366 break;
367
368 case ACPI_TYPE_BUFFER:
369 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X",
370 ObjDesc->Buffer.Length));
371
372 /* Dump some of the buffer */
373
374 if (ObjDesc->Buffer.Length > 0)
375 {
376 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ="));
377 for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
378 {
379 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %.2X",
380 ObjDesc->Buffer.Pointer[i]));
381 }
382 }
383 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
384 break;
385
386 case ACPI_TYPE_STRING:
387 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X",
388 ObjDesc->String.Length));
389
390 if (ObjDesc->String.Length > 0)
391 {
392 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = \"%.32s\"...",
393 ObjDesc->String.Pointer));
394 }
395 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
396 break;
397
398 case ACPI_TYPE_REGION:
399 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]",
400 AcpiUtGetRegionName (ObjDesc->Region.SpaceId)));
401 if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
402 {
403 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Addr %8.8X%8.8X Len %.4X\n",
404 HIDWORD(ObjDesc->Region.Address),
405 LODWORD(ObjDesc->Region.Address),
406 ObjDesc->Region.Length));
407 }
408 else
409 {
410 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [Address/Length not evaluated]\n"));
411 }
412 break;
413
414 case INTERNAL_TYPE_REFERENCE:
415 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]\n",
416 AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode)));
417 break;
418
419 case ACPI_TYPE_BUFFER_FIELD:
420
421 /* TBD: print Buffer name when we can easily get it */
422 break;
423
424 case INTERNAL_TYPE_REGION_FIELD:
425 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]",
426 (char *) &ObjDesc->CommonField.RegionObj->Region.Node->Name));
427 break;
428
429 case INTERNAL_TYPE_BANK_FIELD:
430 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]",
431 (char *) &ObjDesc->CommonField.RegionObj->Region.Node->Name));
432 break;
433
434 case INTERNAL_TYPE_INDEX_FIELD:
435 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]",
436 (char *) &ObjDesc->IndexField.IndexObj->CommonField.RegionObj->Region.Node->Name));
437 break;
438
439 default:
440
441 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Object %p\n", ObjDesc));
442 break;
443 }
444
445 /* Common field handling */
446
447 switch (Type)
448 {
449 case ACPI_TYPE_BUFFER_FIELD:
450 case INTERNAL_TYPE_REGION_FIELD:
451 case INTERNAL_TYPE_BANK_FIELD:
452 case INTERNAL_TYPE_INDEX_FIELD:
453 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Off %.2X Len %.2X Acc %.2d\n",
454 (ObjDesc->CommonField.BaseByteOffset * 8) + ObjDesc->CommonField.StartFieldBitOffset,
455 ObjDesc->CommonField.BitLength,
456 ObjDesc->CommonField.AccessBitWidth));
457 break;
458 }
459
460 break;
461
462
463 case ACPI_DISPLAY_OBJECTS:
464
465 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p O:%p",
466 ThisNode, ObjDesc));
467
468 if (!ObjDesc)
469 {
470 /* No attached object, we are done */
471
472 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
473 return (AE_OK);
474 }
475
476 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(R%d)",
477 ObjDesc->Common.ReferenceCount));
478
479 switch (Type)
480 {
481
482 case ACPI_TYPE_METHOD:
483
484 /* Name is a Method and its AML offset/length are set */
485
486 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n",
487 ObjDesc->Method.AmlStart,
488 ObjDesc->Method.AmlLength));
489
490 break;
491
492
493 case ACPI_TYPE_INTEGER:
494
495 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X%X\n",
496 HIDWORD(ObjDesc->Integer.Value),
497 LODWORD(ObjDesc->Integer.Value)));
498 break;
499
500
501 case ACPI_TYPE_STRING:
502
503 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n",
504 ObjDesc->String.Pointer,
505 ObjDesc->String.Length));
506 break;
507
508
509 case ACPI_TYPE_BUFFER:
510
511 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n",
512 ObjDesc->Buffer.Pointer,
513 ObjDesc->Buffer.Length));
514 break;
515
516
517 default:
518
519 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
520 break;
521 }
522 break;
523 }
524
525 /* If debug turned off, done */
526
527 if (!(AcpiDbgLevel & ACPI_LV_VALUES))
528 {
529 return (AE_OK);
530 }
531
532
533 /* If there is an attached object, display it */
534
535 ObjDesc = ThisNode->Object;
536
537 /* Dump attached objects */
538
539 while (ObjDesc)
540 {
541 ObjType = INTERNAL_TYPE_INVALID;
542
543 /* Decode the type of attached object and dump the contents */
544
545 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", ObjDesc));
546
547 if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_NAMED))
548 {
549 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n"));
550 BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
551 }
552
553
554 else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_INTERNAL))
555 {
556 ObjType = ObjDesc->Common.Type;
557
558 if (ObjType > INTERNAL_TYPE_MAX)
559 {
560 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType));
561 BytesToDump = 32;
562 }
563
564 else
565 {
566 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %2.2X [%s])\n",
567 ObjType, AcpiUtGetTypeName (ObjType)));
568 BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
569 }
570 }
571
572 else
573 {
574 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n"));
575 BytesToDump = 16;
576 }
577
578 DUMP_BUFFER (ObjDesc, BytesToDump);
579
580 /* If value is NOT an internal object, we are done */
581
582 if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_NAMED))

--- 37 unchanged lines hidden (view full) ---

620 case INTERNAL_TYPE_INDEX_FIELD:
621 ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->IndexField.IndexObj;
622 break;
623
624 default:
625 goto Cleanup;
626 }
627
628 ObjType = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */
629 }
630
631Cleanup:
632 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n"));
633 return (AE_OK);
634}
635
636
637/*******************************************************************************
638 *
639 * FUNCTION: AcpiNsDumpObjects
640 *

--- 153 unchanged lines hidden (view full) ---

794 {
795 /* entire namespace */
796
797 SearchHandle = AcpiGbl_RootNode;
798 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
799 }
800
801
802 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
803 ACPI_UINT32_MAX, SearchHandle);
804 return_VOID;
805}
806
807
808/*******************************************************************************
809 *
810 * FUNCTION: AcpiNsDumpEntry

--- 13 unchanged lines hidden (view full) ---

824 ACPI_WALK_INFO Info;
825
826
827 FUNCTION_ENTRY ();
828
829
830 Info.DebugLevel = DebugLevel;
831 Info.OwnerId = ACPI_UINT32_MAX;
832
833 AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
834}
835
836#endif
837