Deleted Added
full compact
nsdump.c (104470) nsdump.c (107325)
1/******************************************************************************
2 *
3 * Module Name: nsdump - table dumping routines for debug
1/******************************************************************************
2 *
3 * Module Name: nsdump - table dumping routines for debug
4 * $Revision: 141 $
4 * $Revision: 146 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

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

243 void **ReturnValue)
244{
245 ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
246 ACPI_NAMESPACE_NODE *ThisNode;
247 ACPI_OPERAND_OBJECT *ObjDesc = NULL;
248 ACPI_OBJECT_TYPE ObjType;
249 ACPI_OBJECT_TYPE Type;
250 UINT32 BytesToDump;
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

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

243 void **ReturnValue)
244{
245 ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
246 ACPI_NAMESPACE_NODE *ThisNode;
247 ACPI_OPERAND_OBJECT *ObjDesc = NULL;
248 ACPI_OBJECT_TYPE ObjType;
249 ACPI_OBJECT_TYPE Type;
250 UINT32 BytesToDump;
251 UINT32 DownstreamSiblingMask = 0;
252 UINT32 LevelTmp;
253 UINT32 WhichBit;
254 UINT32 i;
255 UINT32 DbgLevel;
251 UINT32 DbgLevel;
252 UINT32 i;
256
257
258 ACPI_FUNCTION_NAME ("NsDumpOneObject");
259
260
253
254
255 ACPI_FUNCTION_NAME ("NsDumpOneObject");
256
257
261 ThisNode = AcpiNsMapHandleToNode (ObjHandle);
258 /* Is output enabled? */
262
259
263 LevelTmp = Level;
264 Type = ThisNode->Type;
265 WhichBit = 1;
266
267
268 if (!(AcpiDbgLevel & Info->DebugLevel))
269 {
270 return (AE_OK);
271 }
272
273 if (!ObjHandle)
274 {
275 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
276 return (AE_OK);
277 }
278
260 if (!(AcpiDbgLevel & Info->DebugLevel))
261 {
262 return (AE_OK);
263 }
264
265 if (!ObjHandle)
266 {
267 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
268 return (AE_OK);
269 }
270
271 ThisNode = AcpiNsMapHandleToNode (ObjHandle);
272 Type = ThisNode->Type;
273
279 /* Check if the owner matches */
280
281 if ((Info->OwnerId != ACPI_UINT32_MAX) &&
282 (Info->OwnerId != ThisNode->OwnerId))
283 {
284 return (AE_OK);
285 }
286
287 /* Indent the object according to the level */
288
274 /* Check if the owner matches */
275
276 if ((Info->OwnerId != ACPI_UINT32_MAX) &&
277 (Info->OwnerId != ThisNode->OwnerId))
278 {
279 return (AE_OK);
280 }
281
282 /* Indent the object according to the level */
283
289 while (LevelTmp--)
290 {
291 /* Print appropriate characters to form tree structure */
284 AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
292
285
293 if (LevelTmp)
294 {
295 if (DownstreamSiblingMask & WhichBit)
296 {
297 AcpiOsPrintf ("|");
298 }
299 else
300 {
301 AcpiOsPrintf (" ");
302 }
286 /* Check the node type and name */
303
287
304 WhichBit <<= 1;
305 }
306 else
307 {
308 if (AcpiNsExistDownstreamSibling (ThisNode + 1))
309 {
310 DownstreamSiblingMask |= ((UINT32) 1 << (Level - 1));
311 AcpiOsPrintf ("+");
312 }
313 else
314 {
315 DownstreamSiblingMask &= ACPI_UINT32_MAX ^ ((UINT32) 1 << (Level - 1));
316 AcpiOsPrintf ("+");
317 }
318
319 if (ThisNode->Child == NULL)
320 {
321 AcpiOsPrintf ("-");
322 }
323 else if (AcpiNsExistDownstreamSibling (ThisNode->Child))
324 {
325 AcpiOsPrintf ("+");
326 }
327 else
328 {
329 AcpiOsPrintf ("-");
330 }
331 }
332 }
333
334 /* Check the integrity of our data */
335
336 if (Type > INTERNAL_TYPE_MAX)
288 if (Type > ACPI_TYPE_LOCAL_MAX)
337 {
289 {
338 Type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */
290 ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", Type));
339 }
340
341 if (!AcpiUtValidAcpiName (ThisNode->Name.Integer))
342 {
343 ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", ThisNode->Name.Integer));
344 }
345
346 /*
347 * Now we can print out the pertinent information
348 */
291 }
292
293 if (!AcpiUtValidAcpiName (ThisNode->Name.Integer))
294 {
295 ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", ThisNode->Name.Integer));
296 }
297
298 /*
299 * Now we can print out the pertinent information
300 */
349 AcpiOsPrintf (" %4.4s %-12s %p",
301 AcpiOsPrintf ("%4.4s %-12s %p ",
350 ThisNode->Name.Ascii, AcpiUtGetTypeName (Type), ThisNode);
351
352 DbgLevel = AcpiDbgLevel;
353 AcpiDbgLevel = 0;
354 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
355 AcpiDbgLevel = DbgLevel;
356
357 switch (Info->DisplayType)

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

365 AcpiOsPrintf ("\n");
366 return (AE_OK);
367 }
368
369 switch (Type)
370 {
371 case ACPI_TYPE_PROCESSOR:
372
302 ThisNode->Name.Ascii, AcpiUtGetTypeName (Type), ThisNode);
303
304 DbgLevel = AcpiDbgLevel;
305 AcpiDbgLevel = 0;
306 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
307 AcpiDbgLevel = DbgLevel;
308
309 switch (Info->DisplayType)

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

317 AcpiOsPrintf ("\n");
318 return (AE_OK);
319 }
320
321 switch (Type)
322 {
323 case ACPI_TYPE_PROCESSOR:
324
373 AcpiOsPrintf (" ID %X Len %.4X Addr %p\n",
325 AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
374 ObjDesc->Processor.ProcId,
375 ObjDesc->Processor.Length,
376 (char *) ObjDesc->Processor.Address);
377 break;
378
379
380 case ACPI_TYPE_DEVICE:
381
326 ObjDesc->Processor.ProcId,
327 ObjDesc->Processor.Length,
328 (char *) ObjDesc->Processor.Address);
329 break;
330
331
332 case ACPI_TYPE_DEVICE:
333
382 AcpiOsPrintf (" Notification object: %p", ObjDesc);
334 AcpiOsPrintf ("Notify object: %p", ObjDesc);
383 break;
384
385
386 case ACPI_TYPE_METHOD:
387
335 break;
336
337
338 case ACPI_TYPE_METHOD:
339
388 AcpiOsPrintf (" Args %X Len %.4X Aml %p\n",
340 AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
389 (UINT32) ObjDesc->Method.ParamCount,
390 ObjDesc->Method.AmlLength,
391 ObjDesc->Method.AmlStart);
392 break;
393
394
395 case ACPI_TYPE_INTEGER:
396
341 (UINT32) ObjDesc->Method.ParamCount,
342 ObjDesc->Method.AmlLength,
343 ObjDesc->Method.AmlStart);
344 break;
345
346
347 case ACPI_TYPE_INTEGER:
348
397 AcpiOsPrintf (" = %8.8X%8.8X\n",
349 AcpiOsPrintf ("= %8.8X%8.8X\n",
398 ACPI_HIDWORD (ObjDesc->Integer.Value),
399 ACPI_LODWORD (ObjDesc->Integer.Value));
400 break;
401
402
403 case ACPI_TYPE_PACKAGE:
404
405 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
406 {
350 ACPI_HIDWORD (ObjDesc->Integer.Value),
351 ACPI_LODWORD (ObjDesc->Integer.Value));
352 break;
353
354
355 case ACPI_TYPE_PACKAGE:
356
357 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
358 {
407 AcpiOsPrintf (" Elements %.2X\n",
359 AcpiOsPrintf ("Elements %.2X\n",
408 ObjDesc->Package.Count);
409 }
410 else
411 {
360 ObjDesc->Package.Count);
361 }
362 else
363 {
412 AcpiOsPrintf (" [Length not yet evaluated]\n");
364 AcpiOsPrintf ("[Length not yet evaluated]\n");
413 }
414 break;
415
416
417 case ACPI_TYPE_BUFFER:
418
419 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
420 {
365 }
366 break;
367
368
369 case ACPI_TYPE_BUFFER:
370
371 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
372 {
421 AcpiOsPrintf (" Len %.2X",
373 AcpiOsPrintf ("Len %.2X",
422 ObjDesc->Buffer.Length);
423
424 /* Dump some of the buffer */
425
426 if (ObjDesc->Buffer.Length > 0)
427 {
428 AcpiOsPrintf (" =");
429 for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
430 {
431 AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
432 }
433 }
434 AcpiOsPrintf ("\n");
435 }
436 else
437 {
374 ObjDesc->Buffer.Length);
375
376 /* Dump some of the buffer */
377
378 if (ObjDesc->Buffer.Length > 0)
379 {
380 AcpiOsPrintf (" =");
381 for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
382 {
383 AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
384 }
385 }
386 AcpiOsPrintf ("\n");
387 }
388 else
389 {
438 AcpiOsPrintf (" [Length not yet evaluated]\n");
390 AcpiOsPrintf ("[Length not yet evaluated]\n");
439 }
440 break;
441
442
443 case ACPI_TYPE_STRING:
444
391 }
392 break;
393
394
395 case ACPI_TYPE_STRING:
396
445 AcpiOsPrintf (" Len %.2X", ObjDesc->String.Length);
446
447 if (ObjDesc->String.Length > 0)
448 {
449 AcpiOsPrintf (" = \"%.32s\"", ObjDesc->String.Pointer);
450 if (ObjDesc->String.Length > 32)
451 {
452 AcpiOsPrintf ("...");
453 }
454 }
397 AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
398 AcpiUtPrintString (ObjDesc->String.Pointer, 32);
455 AcpiOsPrintf ("\n");
456 break;
457
458
459 case ACPI_TYPE_REGION:
460
399 AcpiOsPrintf ("\n");
400 break;
401
402
403 case ACPI_TYPE_REGION:
404
461 AcpiOsPrintf (" [%s]", AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
405 AcpiOsPrintf ("[%s]", AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
462 if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
463 {
464 AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
465 ACPI_HIDWORD (ObjDesc->Region.Address),
466 ACPI_LODWORD (ObjDesc->Region.Address),
467 ObjDesc->Region.Length);
468 }
469 else
470 {
471 AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
472 }
473 break;
474
475
406 if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
407 {
408 AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
409 ACPI_HIDWORD (ObjDesc->Region.Address),
410 ACPI_LODWORD (ObjDesc->Region.Address),
411 ObjDesc->Region.Length);
412 }
413 else
414 {
415 AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
416 }
417 break;
418
419
476 case INTERNAL_TYPE_REFERENCE:
420 case ACPI_TYPE_LOCAL_REFERENCE:
477
421
478 AcpiOsPrintf (" [%s]\n",
422 AcpiOsPrintf ("[%s]\n",
479 AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode));
480 break;
481
482
483 case ACPI_TYPE_BUFFER_FIELD:
484
485 if (ObjDesc->BufferField.BufferObj &&
486 ObjDesc->BufferField.BufferObj->Buffer.Node)
487 {
423 AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode));
424 break;
425
426
427 case ACPI_TYPE_BUFFER_FIELD:
428
429 if (ObjDesc->BufferField.BufferObj &&
430 ObjDesc->BufferField.BufferObj->Buffer.Node)
431 {
488 AcpiOsPrintf (" Buf [%4.4s]",
432 AcpiOsPrintf ("Buf [%4.4s]",
489 ObjDesc->BufferField.BufferObj->Buffer.Node->Name.Ascii);
490 }
491 break;
492
493
433 ObjDesc->BufferField.BufferObj->Buffer.Node->Name.Ascii);
434 }
435 break;
436
437
494 case INTERNAL_TYPE_REGION_FIELD:
438 case ACPI_TYPE_LOCAL_REGION_FIELD:
495
439
496 AcpiOsPrintf (" Rgn [%4.4s]",
440 AcpiOsPrintf ("Rgn [%4.4s]",
497 ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii);
498 break;
499
500
441 ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii);
442 break;
443
444
501 case INTERNAL_TYPE_BANK_FIELD:
445 case ACPI_TYPE_LOCAL_BANK_FIELD:
502
446
503 AcpiOsPrintf (" Rgn [%4.4s] Bnk [%4.4s]",
447 AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
504 ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii,
505 ObjDesc->BankField.BankObj->CommonField.Node->Name.Ascii);
506 break;
507
508
448 ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii,
449 ObjDesc->BankField.BankObj->CommonField.Node->Name.Ascii);
450 break;
451
452
509 case INTERNAL_TYPE_INDEX_FIELD:
453 case ACPI_TYPE_LOCAL_INDEX_FIELD:
510
454
511 AcpiOsPrintf (" Idx [%4.4s] Dat [%4.4s]",
455 AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
512 ObjDesc->IndexField.IndexObj->CommonField.Node->Name.Ascii,
513 ObjDesc->IndexField.DataObj->CommonField.Node->Name.Ascii);
514 break;
515
516
456 ObjDesc->IndexField.IndexObj->CommonField.Node->Name.Ascii,
457 ObjDesc->IndexField.DataObj->CommonField.Node->Name.Ascii);
458 break;
459
460
517 case INTERNAL_TYPE_ALIAS:
461 case ACPI_TYPE_LOCAL_ALIAS:
518
462
519 AcpiOsPrintf (" Target %4.4s (%p)\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Name.Ascii, ObjDesc);
463 AcpiOsPrintf ("Target %4.4s (%p)\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Name.Ascii, ObjDesc);
520 break;
521
522 default:
523
464 break;
465
466 default:
467
524 AcpiOsPrintf (" Object %p\n", ObjDesc);
468 AcpiOsPrintf ("Object %p\n", ObjDesc);
525 break;
526 }
527
528 /* Common field handling */
529
530 switch (Type)
531 {
532 case ACPI_TYPE_BUFFER_FIELD:
469 break;
470 }
471
472 /* Common field handling */
473
474 switch (Type)
475 {
476 case ACPI_TYPE_BUFFER_FIELD:
533 case INTERNAL_TYPE_REGION_FIELD:
534 case INTERNAL_TYPE_BANK_FIELD:
535 case INTERNAL_TYPE_INDEX_FIELD:
477 case ACPI_TYPE_LOCAL_REGION_FIELD:
478 case ACPI_TYPE_LOCAL_BANK_FIELD:
479 case ACPI_TYPE_LOCAL_INDEX_FIELD:
480
536 AcpiOsPrintf (" Off %.2X Len %.2X Acc %.2hd\n",
537 (ObjDesc->CommonField.BaseByteOffset * 8)
538 + ObjDesc->CommonField.StartFieldBitOffset,
539 ObjDesc->CommonField.BitLength,
540 ObjDesc->CommonField.AccessByteWidth);
541 break;
542
543 default:
544 break;
545 }
546 break;
547
548
549 case ACPI_DISPLAY_OBJECTS:
550
481 AcpiOsPrintf (" Off %.2X Len %.2X Acc %.2hd\n",
482 (ObjDesc->CommonField.BaseByteOffset * 8)
483 + ObjDesc->CommonField.StartFieldBitOffset,
484 ObjDesc->CommonField.BitLength,
485 ObjDesc->CommonField.AccessByteWidth);
486 break;
487
488 default:
489 break;
490 }
491 break;
492
493
494 case ACPI_DISPLAY_OBJECTS:
495
551 AcpiOsPrintf ("%p O:%p",
552 ThisNode, ObjDesc);
553
496 AcpiOsPrintf ("O:%p", ObjDesc);
554 if (!ObjDesc)
555 {
556 /* No attached object, we are done */
557
558 AcpiOsPrintf ("\n");
559 return (AE_OK);
560 }
561

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

617 AcpiDbgLevel = 0;
618 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
619 AcpiDbgLevel = DbgLevel;
620
621 /* Dump attached objects */
622
623 while (ObjDesc)
624 {
497 if (!ObjDesc)
498 {
499 /* No attached object, we are done */
500
501 AcpiOsPrintf ("\n");
502 return (AE_OK);
503 }
504

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

560 AcpiDbgLevel = 0;
561 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
562 AcpiDbgLevel = DbgLevel;
563
564 /* Dump attached objects */
565
566 while (ObjDesc)
567 {
625 ObjType = INTERNAL_TYPE_INVALID;
568 ObjType = ACPI_TYPE_INVALID;
626 AcpiOsPrintf (" Attached Object %p: ", ObjDesc);
627
628 /* Decode the type of attached object and dump the contents */
629
630 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
631 {
632 case ACPI_DESC_TYPE_NAMED:
633
634 AcpiOsPrintf ("(Ptr to Node)\n");
635 BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
636 break;
637
638
639 case ACPI_DESC_TYPE_OPERAND:
640
641 ObjType = ACPI_GET_OBJECT_TYPE (ObjDesc);
642
569 AcpiOsPrintf (" Attached Object %p: ", ObjDesc);
570
571 /* Decode the type of attached object and dump the contents */
572
573 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
574 {
575 case ACPI_DESC_TYPE_NAMED:
576
577 AcpiOsPrintf ("(Ptr to Node)\n");
578 BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
579 break;
580
581
582 case ACPI_DESC_TYPE_OPERAND:
583
584 ObjType = ACPI_GET_OBJECT_TYPE (ObjDesc);
585
643 if (ObjType > INTERNAL_TYPE_MAX)
586 if (ObjType > ACPI_TYPE_LOCAL_MAX)
644 {
645 AcpiOsPrintf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType);
646 BytesToDump = 32;
647 }
648 else
649 {
650 AcpiOsPrintf ("(Ptr to ACPI Object type %s, %X)\n",
651 AcpiUtGetTypeName (ObjType), ObjType);

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

690 case ACPI_TYPE_PACKAGE:
691 ObjDesc = (void *) ObjDesc->Package.Elements;
692 break;
693
694 case ACPI_TYPE_METHOD:
695 ObjDesc = (void *) ObjDesc->Method.AmlStart;
696 break;
697
587 {
588 AcpiOsPrintf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType);
589 BytesToDump = 32;
590 }
591 else
592 {
593 AcpiOsPrintf ("(Ptr to ACPI Object type %s, %X)\n",
594 AcpiUtGetTypeName (ObjType), ObjType);

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

633 case ACPI_TYPE_PACKAGE:
634 ObjDesc = (void *) ObjDesc->Package.Elements;
635 break;
636
637 case ACPI_TYPE_METHOD:
638 ObjDesc = (void *) ObjDesc->Method.AmlStart;
639 break;
640
698 case INTERNAL_TYPE_REGION_FIELD:
641 case ACPI_TYPE_LOCAL_REGION_FIELD:
699 ObjDesc = (void *) ObjDesc->Field.RegionObj;
700 break;
701
642 ObjDesc = (void *) ObjDesc->Field.RegionObj;
643 break;
644
702 case INTERNAL_TYPE_BANK_FIELD:
645 case ACPI_TYPE_LOCAL_BANK_FIELD:
703 ObjDesc = (void *) ObjDesc->BankField.RegionObj;
704 break;
705
646 ObjDesc = (void *) ObjDesc->BankField.RegionObj;
647 break;
648
706 case INTERNAL_TYPE_INDEX_FIELD:
649 case ACPI_TYPE_LOCAL_INDEX_FIELD:
707 ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
708 break;
709
710 default:
711 goto Cleanup;
712 }
713
650 ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
651 break;
652
653 default:
654 goto Cleanup;
655 }
656
714 ObjType = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */
657 ObjType = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
715 }
716
717Cleanup:
718 AcpiOsPrintf ("\n");
719 return (AE_OK);
720}
721
722

--- 121 unchanged lines hidden ---
658 }
659
660Cleanup:
661 AcpiOsPrintf ("\n");
662 return (AE_OK);
663}
664
665

--- 121 unchanged lines hidden ---