Deleted Added
full compact
adisasm.c (228110) adisasm.c (229989)
1/******************************************************************************
2 *
3 * Module Name: adisasm - Application-level disassembler routines
4 *
5 *****************************************************************************/
6
7/*
1/******************************************************************************
2 *
3 * Module Name: adisasm - Application-level disassembler routines
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2011, Intel Corp.
8 * Copyright (C) 2000 - 2012, Intel Corp.
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.

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

371
372 *OutFilename = DisasmFilename;
373
374 if (!AcpiUtIsAmlTable (Table))
375 {
376 AdDisassemblerHeader (Filename);
377 AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
378 Table->Signature);
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.

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

371
372 *OutFilename = DisasmFilename;
373
374 if (!AcpiUtIsAmlTable (Table))
375 {
376 AdDisassemblerHeader (Filename);
377 AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
378 Table->Signature);
379 AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue\n */\n\n");
379 AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
380 "FieldName : FieldValue\n */\n\n");
380
381 AcpiDmDumpDataTable (Table);
382 fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n",
383 Table->Signature, DisasmFilename);
384 }
385 else
386 {
387 /* Always parse the tables, only option is what to display */

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

398 {
399 AcpiOsPrintf ("/**** Before second load\n");
400
401 LsSetupNsList (File);
402 LsDisplayNamespace ();
403 AcpiOsPrintf ("*****/\n");
404 }
405
381
382 AcpiDmDumpDataTable (Table);
383 fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n",
384 Table->Signature, DisasmFilename);
385 }
386 else
387 {
388 /* Always parse the tables, only option is what to display */

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

399 {
400 AcpiOsPrintf ("/**** Before second load\n");
401
402 LsSetupNsList (File);
403 LsDisplayNamespace ();
404 AcpiOsPrintf ("*****/\n");
405 }
406
406 /*
407 * Load namespace from names created within control methods
408 */
409 AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId);
407 /* Load namespace from names created within control methods */
410
408
409 AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
410 AcpiGbl_RootNode, OwnerId);
411
411 /*
412 /*
412 * Cross reference the namespace here, in order to generate External() statements
413 * Cross reference the namespace here, in order to
414 * generate External() statements
413 */
415 */
414 AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId);
416 AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
417 AcpiGbl_RootNode, OwnerId);
415
416 if (AslCompilerdebug)
417 {
418 AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
419 }
420
421 /* Find possible calls to external control methods */
422
423 AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot);
424
418
419 if (AslCompilerdebug)
420 {
421 AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
422 }
423
424 /* Find possible calls to external control methods */
425
426 AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot);
427
425 /* Convert fixed-offset references to resource descriptors to symbolic references */
426
427 AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
428
429 /*
428 /*
430 * If we found any external control methods, we must reparse the entire
431 * tree with the new information (namely, the number of arguments per
432 * method)
429 * If we found any external control methods, we must reparse
430 * the entire tree with the new information (namely, the
431 * number of arguments per method)
433 */
434 if (AcpiDmGetExternalMethodCount ())
435 {
436 fprintf (stderr,
432 */
433 if (AcpiDmGetExternalMethodCount ())
434 {
435 fprintf (stderr,
437 "\nFound %u external control methods, reparsing with new information\n",
436 "\nFound %u external control methods, "
437 "reparsing with new information\n",
438 AcpiDmGetExternalMethodCount ());
439
438 AcpiDmGetExternalMethodCount ());
439
440 /*
441 * Reparse, rebuild namespace. no need to xref namespace
442 */
440 /* Reparse, rebuild namespace. no need to xref namespace */
441
443 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
444 AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
445
446 AcpiGbl_RootNode = NULL;
447 AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
448 AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
449 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
450 AcpiGbl_RootNodeStruct.Parent = NULL;
451 AcpiGbl_RootNodeStruct.Child = NULL;
452 AcpiGbl_RootNodeStruct.Peer = NULL;
453 AcpiGbl_RootNodeStruct.Object = NULL;
454 AcpiGbl_RootNodeStruct.Flags = 0;
455
456 Status = AcpiNsRootInitialize ();
457 AcpiDmAddExternalsToNamespace ();
458
442 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
443 AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
444
445 AcpiGbl_RootNode = NULL;
446 AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
447 AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
448 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
449 AcpiGbl_RootNodeStruct.Parent = NULL;
450 AcpiGbl_RootNodeStruct.Child = NULL;
451 AcpiGbl_RootNodeStruct.Peer = NULL;
452 AcpiGbl_RootNodeStruct.Object = NULL;
453 AcpiGbl_RootNodeStruct.Flags = 0;
454
455 Status = AcpiNsRootInitialize ();
456 AcpiDmAddExternalsToNamespace ();
457
459 /* Parse table. No need to reload it, however (FALSE) */
458 /* Parse the table again. No need to reload it, however */
460
461 Status = AdParseTable (Table, NULL, FALSE, FALSE);
462 if (ACPI_FAILURE (Status))
463 {
464 AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
465 AcpiFormatException (Status));
466 goto Cleanup;
467 }

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

472 LsSetupNsList (File);
473 LsDisplayNamespace ();
474 AcpiOsPrintf ("*****/\n");
475
476 AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
477 }
478 }
479
459
460 Status = AdParseTable (Table, NULL, FALSE, FALSE);
461 if (ACPI_FAILURE (Status))
462 {
463 AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
464 AcpiFormatException (Status));
465 goto Cleanup;
466 }

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

471 LsSetupNsList (File);
472 LsDisplayNamespace ();
473 AcpiOsPrintf ("*****/\n");
474
475 AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
476 }
477 }
478
479 /*
480 * Now that the namespace is finalized, we can perform namespace
481 * transforms.
482 *
483 * 1) Convert fixed-offset references to resource descriptors
484 * to symbolic references (Note: modifies namespace)
485 */
486 AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
487
480 /* Optional displays */
481
482 if (AcpiGbl_DbOpt_disasm)
483 {
484 AdDisplayTables (Filename, Table);
485 fprintf (stderr,
486 "Disassembly completed, written to \"%s\"\n",
487 DisasmFilename);

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

497
498 if (DisasmFilename)
499 {
500 ACPI_FREE (DisasmFilename);
501 }
502
503 if (OutToFile && File)
504 {
488 /* Optional displays */
489
490 if (AcpiGbl_DbOpt_disasm)
491 {
492 AdDisplayTables (Filename, Table);
493 fprintf (stderr,
494 "Disassembly completed, written to \"%s\"\n",
495 DisasmFilename);

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

505
506 if (DisasmFilename)
507 {
508 ACPI_FREE (DisasmFilename);
509 }
510
511 if (OutToFile && File)
512 {
513 if (AslCompilerdebug) /* Display final namespace, with transforms */
514 {
515 LsSetupNsList (File);
516 LsDisplayNamespace ();
517 }
505
518
506#ifdef ASL_DISASM_DEBUG
507 LsSetupNsList (File);
508 LsDisplayNamespace ();
509#endif
510 fclose (File);
511 AcpiOsRedirectOutput (stdout);
512 }
513
514 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
515 AcpiGbl_ParseOpRoot = NULL;
516 return (Status);
517}

--- 630 unchanged lines hidden ---
519 fclose (File);
520 AcpiOsRedirectOutput (stdout);
521 }
522
523 AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
524 AcpiGbl_ParseOpRoot = NULL;
525 return (Status);
526}

--- 630 unchanged lines hidden ---