diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/dmtable.c | 75 | ||||
| -rw-r--r-- | common/dmtbdump.c | 6 |
2 files changed, 53 insertions, 28 deletions
diff --git a/common/dmtable.c b/common/dmtable.c index 6d8e58c6fcd8..febb7eab2930 100644 --- a/common/dmtable.c +++ b/common/dmtable.c @@ -62,6 +62,13 @@ AcpiDmCheckAscii ( UINT32 Count); +/* Common format strings for commented values */ + +#define UINT8_FORMAT "%2.2X [%s]\n" +#define UINT16_FORMAT "%4.4X [%s]\n" +#define UINT32_FORMAT "%8.8X [%s]\n" +#define STRING_FORMAT "[%s]\n" + /* These tables map a subtable type to a description string */ static const char *AcpiDmAsfSubnames[] = @@ -497,7 +504,14 @@ AcpiDmLineHeader ( } else { - AcpiOsPrintf ("%41s : ", Name); + if (*Name) + { + AcpiOsPrintf ("%41s : ", Name); + } + else + { + AcpiOsPrintf ("%41s ", Name); + } } } else /* Normal disassembler or verbose template */ @@ -509,7 +523,14 @@ AcpiDmLineHeader ( } else { - AcpiOsPrintf ("%44s : ", Name); + if (*Name) + { + AcpiOsPrintf ("%44s : ", Name); + } + else + { + AcpiOsPrintf ("%44s ", Name); + } } } } @@ -526,7 +547,7 @@ AcpiDmLineHeader2 ( { if (ByteLength) { - AcpiOsPrintf ("[%.3d] %30s % 3d : ", + AcpiOsPrintf ("[%.4d] %30s %3d : ", ByteLength, Name, Value); } else @@ -539,12 +560,12 @@ AcpiDmLineHeader2 ( { if (ByteLength) { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", + AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ", Offset, Offset, ByteLength, Name, Value); } else { - AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", + AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ", Offset, Offset, Name, Value); } } @@ -774,6 +795,7 @@ AcpiDmDumpTable ( /* * Buffer: Size depends on the opcode and was set above. * Each hex byte is separated with a space. + * Multiple lines are separated by line continuation char. */ for (Temp16 = 0; Temp16 < ByteLength; Temp16++) { @@ -782,7 +804,7 @@ AcpiDmDumpTable ( { if ((Temp16 > 0) && (!((Temp16+1) % 16))) { - AcpiOsPrintf ("\n"); + AcpiOsPrintf (" \\\n"); /* Line continuation */ AcpiDmLineHeader (0, 0, NULL); } else @@ -817,9 +839,12 @@ AcpiDmDumpTable ( TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target)); if (TableData) { - AcpiOsPrintf ("/* %s */", TableData->Name); + AcpiOsPrintf (STRING_FORMAT, TableData->Name); + } + else + { + AcpiOsPrintf ("\n"); } - AcpiOsPrintf ("\n"); break; case ACPI_DMT_NAME4: @@ -862,7 +887,7 @@ AcpiDmDumpTable ( /* Address Space ID */ - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiUtGetRegionName (*Target)); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target)); break; case ACPI_DMT_ACCWIDTH: @@ -875,14 +900,14 @@ AcpiDmDumpTable ( Temp8 = ACPI_GAS_WIDTH_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", Temp8, AcpiDmGasAccessWidth[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, Temp8, AcpiDmGasAccessWidth[Temp8]); break; case ACPI_DMT_GAS: /* Generic Address Structure */ - AcpiOsPrintf ("<Generic Address Structure>\n"); + AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure"); AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); AcpiOsPrintf ("\n"); @@ -899,7 +924,7 @@ AcpiDmDumpTable ( Temp16 = ACPI_ASF_TYPE_RESERVED; } - AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmAsfSubnames[Temp16]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]); break; case ACPI_DMT_DMAR: @@ -912,7 +937,7 @@ AcpiDmDumpTable ( Temp16 = ACPI_DMAR_TYPE_RESERVED; } - AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); break; case ACPI_DMT_EINJACT: @@ -925,7 +950,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_EINJ_ACTION_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjActions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]); break; case ACPI_DMT_EINJINST: @@ -938,7 +963,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjInstructions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]); break; case ACPI_DMT_ERSTACT: @@ -951,7 +976,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_ERST_ACTION_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstActions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]); break; case ACPI_DMT_ERSTINST: @@ -964,7 +989,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_ERST_INSTRUCTION_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstInstructions[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]); break; case ACPI_DMT_HEST: @@ -977,12 +1002,12 @@ AcpiDmDumpTable ( Temp16 = ACPI_HEST_TYPE_RESERVED; } - AcpiOsPrintf ("%4.4X (%s)\n", ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]); + AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]); break; case ACPI_DMT_HESTNTFY: - AcpiOsPrintf ("<Hardware Error Notification Structure>\n"); + AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure"); AcpiDmDumpTable (TableLength, CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); AcpiOsPrintf ("\n"); @@ -999,7 +1024,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_HEST_NOTIFY_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmHestNotifySubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]); break; case ACPI_DMT_MADT: @@ -1012,7 +1037,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_MADT_TYPE_RESERVED; } - AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]); break; case ACPI_DMT_SLIC: @@ -1025,7 +1050,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_SLIC_TYPE_RESERVED; } - AcpiOsPrintf ("%8.8X <%s>\n", *Target, AcpiDmSlicSubnames[Temp8]); + AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmSlicSubnames[Temp8]); break; case ACPI_DMT_SRAT: @@ -1038,7 +1063,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_SRAT_TYPE_RESERVED; } - AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmSratSubnames[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]); break; case ACPI_DMT_FADTPM: @@ -1051,7 +1076,7 @@ AcpiDmDumpTable ( Temp8 = ACPI_FADT_PM_RESERVED; } - AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]); + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]); break; case ACPI_DMT_IVRS: @@ -1076,7 +1101,7 @@ AcpiDmDumpTable ( break; } - AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name); + AcpiOsPrintf (UINT8_FORMAT, *Target, Name); break; case ACPI_DMT_EXIT: diff --git a/common/dmtbdump.c b/common/dmtbdump.c index 590aeaeefa3f..087d52d19422 100644 --- a/common/dmtbdump.c +++ b/common/dmtbdump.c @@ -1408,12 +1408,12 @@ AcpiDmDumpSlit ( if ((j+1) < Localities) { - AcpiOsPrintf (","); + AcpiOsPrintf (" "); if (j && (((j+1) % 16) == 0)) { - AcpiOsPrintf ("\n"); - AcpiDmLineHeader (Offset, 0, ""); + AcpiOsPrintf ("\\\n"); /* With line continuation char */ + AcpiDmLineHeader (Offset, 0, NULL); } } } |
