18STATIC UINT32 mTableErrorCount;
19STATIC UINT32 mTableWarningCount;
51 return mTableErrorCount;
62 mTableWarningCount = 0;
75 return mTableWarningCount;
125 UINTN OriginalAttribute;
130 OriginalAttribute = 0;
134 while (ByteCount < Length) {
135 Checksum += *(Ptr++);
147 ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)
152 Print (L
"Table Checksum : OK\n\n");
160 ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)
165 Print (L
"Table Checksum : FAILED (0x%X)\n\n", Checksum);
173 return (Checksum == 0);
191 UINTN AsciiBufferIndex;
192 CHAR8 AsciiBuffer[17];
195 AsciiBufferIndex = 0;
197 Print (L
"Address : 0x%p\n", Ptr);
198 Print (L
"Length : %d\n", Length);
200 while (ByteCount < Length) {
201 if ((ByteCount & 0x0F) == 0) {
202 AsciiBuffer[AsciiBufferIndex] =
'\0';
203 Print (L
" %a\n%08X : ", AsciiBuffer, ByteCount);
204 AsciiBufferIndex = 0;
205 }
else if ((ByteCount & 0x07) == 0) {
209 if ((*Ptr >=
' ') && (*Ptr < 0x7F)) {
210 AsciiBuffer[AsciiBufferIndex++] = *Ptr;
212 AsciiBuffer[AsciiBufferIndex++] =
'.';
215 Print (L
"%02X ", *Ptr++);
222 PartLineChars = (Length & 0x0F);
223 if (PartLineChars != 0) {
224 PartLineChars = 48 - (PartLineChars * 3);
225 if ((Length & 0x0F) <= 8) {
229 while (PartLineChars > 0) {
236 AsciiBuffer[AsciiBufferIndex] =
'\0';
237 Print (L
" %a\n\n", AsciiBuffer);
253 Print (Format, *Ptr);
269 Print (Format, *(UINT16 *)Ptr);
285 Print (Format, *(UINT32 *)Ptr);
306 Val = *(UINT32 *)(Ptr +
sizeof (UINT32));
309 Val |= (UINT64)*(UINT32 *)Ptr;
327 IN CONST CHAR16 *Format OPTIONAL,
333 (Format !=
NULL) ? Format : L
"%c%c%c",
353 IN CONST CHAR16 *Format OPTIONAL,
359 (Format !=
NULL) ? Format : L
"%c%c%c%c",
380 IN CONST CHAR16 *Format OPTIONAL,
386 (Format !=
NULL) ? Format : L
"%c%c%c%c%c%c",
409 IN CONST CHAR16 *Format OPTIONAL,
415 (Format !=
NULL) ? Format : L
"%c%c%c%c%c%c%c%c",
440 IN CONST CHAR16 *Format OPTIONAL,
446 (Format !=
NULL) ? Format : L
"%c%c%c%c%c%c%c%c%c%c%c%c",
475 IN CONST CHAR16 *Format OPTIONAL,
481 (Format !=
NULL) ? Format : L
"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
514 IN CONST CHAR16 *Format OPTIONAL,
522 L
"%u %u %u %u %u %u %u %u",
535 L
"%u %u %u %u %u %u %u",
547 L
"%u %u %u %u %u %u",
616 IN CONST CHAR16 *Format OPTIONAL,
623 ByteLength = (Length + 7) >> 3;
650 (OUTPUT_FIELD_COLUMN_WIDTH - gIndent - Indent),
686 IN CONST CHAR8 *AsciiName OPTIONAL,
690 IN UINT32 ParserItems
696 UINTN OriginalAttribute;
701 OriginalAttribute = 0;
707 if (Trace && (AsciiName !=
NULL)) {
716 ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)
725 (OUTPUT_FIELD_COLUMN_WIDTH - gIndent),
733 for (Index = 0; Index < ParserItems; Index++) {
734 if ((Offset + Parser[Index].Length) > Length) {
737 if (Parser[Index].ItemPtr !=
NULL) {
738 *Parser[Index].ItemPtr =
NULL;
746 (Offset != Parser[Index].Offset))
750 L
"\nERROR: %a: Offset Mismatch for %s\n"
751 L
"CurrentOffset = %d FieldOffset = %d\n",
753 Parser[Index].NameStr,
764 if (Parser[Index].PrintFormatter !=
NULL) {
765 Parser[Index].PrintFormatter (Parser[Index].Format, Ptr, Parser[Index].Length);
766 }
else if (Parser[Index].Format !=
NULL) {
767 switch (Parser[Index].Length) {
782 L
"\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length = %d\n",
792 (Parser[Index].FieldValidator !=
NULL))
794 Parser[Index].FieldValidator (
796 Parser[Index].Length,
797 Parser[Index].Context
804 if (Parser[Index].ItemPtr !=
NULL) {
805 *Parser[Index].ItemPtr = (VOID *)Ptr;
808 Ptr += Parser[Index].Length;
809 Offset += Parser[Index].Length;
868 IN CONST CHAR16 *Format OPTIONAL,
933 *Length = AcpiHdrInfo.
Length;
971 IN CONST CHAR8 *AsciiName OPTIONAL,
975 IN UINT32 ParserItems
981 UINTN OriginalAttribute;
986 if ((Length == 0) || (Length > 8)) {
989 L
"\nERROR: Bitfield Length(%d) is zero or exceeding the 64 bit limit.\n",
998 OriginalAttribute = 0;
1004 CopyMem ((VOID *)&BitsData, (VOID *)Ptr, Length);
1005 if (Trace && (AsciiName !=
NULL)) {
1014 ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)
1023 (OUTPUT_FIELD_COLUMN_WIDTH - gIndent),
1031 for (Index = 0; Index < ParserItems; Index++) {
1032 if ((Offset + Parser[Index].Length) > (Length * 8)) {
1035 if (Parser[Index].ItemPtr !=
NULL) {
1036 *Parser[Index].ItemPtr =
NULL;
1043 if (Parser[Index].Length == 0) {
1047 L
"\nERROR: %a: Cannot parse this field, Field Length = %d\n",
1048 Parser[Index].Length
1054 (Offset != Parser[Index].Offset))
1058 L
"\nERROR: %a: Offset Mismatch for %s\n"
1059 L
"CurrentOffset = %d FieldOffset = %d\n",
1061 Parser[Index].NameStr,
1063 Parser[Index].Offset
1068 Data =
RShiftU64 (BitsData, Parser[Index].Offset) & ~(
LShiftU64 (~0ULL, Parser[Index].Length));
1075 if (Parser[Index].PrintFormatter !=
NULL) {
1076 Parser[Index].PrintFormatter (Parser[Index].Format, (UINT8 *)&Data, Parser[Index].Length);
1077 }
else if (Parser[Index].Format !=
NULL) {
1079 switch ((Parser[Index].Length + 7) >> 3) {
1082 DumpUint8 (Parser[Index].Format, (UINT8 *)&Data);
1085 DumpUint16 (Parser[Index].Format, (UINT8 *)&Data);
1089 DumpUint32 (Parser[Index].Format, (UINT8 *)&Data);
1095 DumpUint64 (Parser[Index].Format, (UINT8 *)&Data);
1099 L
"\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length = %d\n",
1101 Parser[Index].Length
1109 (Parser[Index].FieldValidator !=
NULL))
1111 Parser[Index].FieldValidator (
1113 Parser[Index].Length,
1114 Parser[Index].Context
1121 Offset += Parser[Index].Length;
STATIC CONST ACPI_PARSER AcpiHeaderParser[]
VOID EFIAPI Dump16Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
UINT32 EFIAPI ParseAcpiHeader(IN UINT8 *Ptr, OUT CONST UINT32 **Signature, OUT CONST UINT32 **Length, OUT CONST UINT8 **Revision)
VOID EFIAPI IncrementWarningCount(VOID)
UINT32 EFIAPI DumpGasStruct(IN UINT8 *Ptr, IN UINT32 Indent, IN UINT32 Length)
VOID EFIAPI DumpReservedBits(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID ResetWarningCount(VOID)
UINT32 GetErrorCount(VOID)
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI DumpUint16(IN CONST CHAR16 *Format, IN UINT8 *Ptr)
VOID EFIAPI DumpUint64(IN CONST CHAR16 *Format, IN UINT8 *Ptr)
VOID EFIAPI PrintFieldName(IN UINT32 Indent, IN CONST CHAR16 *FieldName)
BOOLEAN EFIAPI VerifyChecksum(IN BOOLEAN Log, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI Dump12Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID ResetErrorCount(VOID)
UINT32 EFIAPI DumpAcpiHeader(IN UINT8 *Ptr)
VOID EFIAPI Dump4Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI Dump8Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI Dump3Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI IncrementErrorCount(VOID)
UINT32 EFIAPI ParseAcpi(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
VOID EFIAPI DumpReserved(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI DumpUint32(IN CONST CHAR16 *Format, IN UINT8 *Ptr)
VOID EFIAPI Dump6Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
UINT32 EFIAPI ParseAcpiBitFields(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
STATIC CONST ACPI_PARSER GasParser[]
UINT32 GetWarningCount(VOID)
VOID EFIAPI DumpUint8(IN CONST CHAR16 *Format, IN UINT8 *Ptr)
VOID EFIAPI DumpRaw(IN UINT8 *Ptr, IN UINT32 Length)
#define PARSER_PARAMS(Parser)
#define PARSE_ACPI_HEADER(Info)
BOOLEAN EFIAPI GetConsistencyChecking(VOID)
BOOLEAN EFIAPI GetColourHighlighting(VOID)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut