From: "Sami Mujawar" <sami.mujawar@arm.com>
To: <devel@edk2.groups.io>
Cc: Sami Mujawar <sami.mujawar@arm.com>, <Alexei.Fedorov@arm.com>,
<Pierre.Gondois@arm.com>, <Matteo.Carlini@arm.com>,
<Ben.Adderson@arm.com>, <nd@arm.com>
Subject: [PATCH v1 5/7] DynamicTablesPkg: AmlLib\AmlDbgPrint fix ECC error
Date: Tue, 22 Sep 2020 15:42:33 +0100 [thread overview]
Message-ID: <20200922144235.76292-6-sami.mujawar@arm.com> (raw)
In-Reply-To: <20200922144235.76292-1-sami.mujawar@arm.com>
Fix ECC error 8001 reported errors in AmlDbgPrint.
[8001] Only capital letters are allowed to be used
for #define declarations.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
DynamicTablesPkg/DynamicTablesPkg.ci.yaml | 1 +
DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.c | 10 ++---
DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.h | 40 ++++++++++++++++----
DynamicTablesPkg/Library/Common/AmlLib/NameSpace/AmlNameSpace.c | 4 +-
DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlFieldListParser.c | 4 +-
DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlMethodParser.c | 10 ++---
DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c | 14 +++----
DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlResourceDataParser.c | 2 +-
8 files changed, 55 insertions(+), 30 deletions(-)
diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
index c0d09e79fdf7f6003b5bbda45abc82a0caf4e53f..ecb05f06fb2b0b8c79c359294de3f91f3e46a5e1 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
+++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
@@ -71,6 +71,7 @@
"ExtendWords": [
"ARMHB", # ARMHB000
"ARMLTD",
+ "AMLDBG",
"EISAID",
"CCIDX",
"CCSIDR",
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.c b/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.c
index 7b11cc8e994903b3a9d2dcfd1241b8a447759717..00a61a2fe63a1ac060cd1bd2ed3f438ca66177ee 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.c
@@ -163,11 +163,11 @@ AmlDbgPrintNameString (
}
if (SegCount != 0) {
- AmlDbgPrintNameSeg (Buffer);
+ AMLDBG_PRINT_NAMESEG (Buffer);
Buffer += AML_NAME_SEG_SIZE;
for (Index = 0; Index < SegCount - 1; Index++) {
DEBUG ((DEBUG_INFO, "."));
- AmlDbgPrintNameSeg (Buffer);
+ AMLDBG_PRINT_NAMESEG (Buffer);
Buffer += AML_NAME_SEG_SIZE;
}
}
@@ -232,7 +232,7 @@ AmlDbgPrintDataNode (
if ((DataNode->DataType == EAmlNodeDataTypeNameString) ||
(DataNode->DataType == EAmlNodeDataTypeString)) {
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_INFO,
(CONST CHAR8*)DataNode->Buffer,
DataNode->Size
@@ -316,7 +316,7 @@ AmlDbgPrintObjectNode (
DEBUG ((DEBUG_INFO, "0x%08x | ", ObjectNode->AmlByteEncoding->Attribute));
DEBUG ((DEBUG_INFO, "0x%04x | ", ObjectNode->PkgLen));
if (AmlNodeHasAttribute (ObjectNode, AML_IN_NAMESPACE)) {
- AmlDbgPrintNameString (
+ AMLDBG_PRINT_NAMESTR (
AmlNodeGetName ((CONST AML_OBJECT_NODE*)ObjectNode),
FALSE
);
@@ -488,7 +488,7 @@ AmlDbgPrintTree (
**/
VOID
EFIAPI
-DumpRaw (
+AmlDbgDumpRaw (
IN CONST UINT8 * Ptr,
IN UINT32 Length
)
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.h b/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.h
index 68f4c7416948a20484b6d5448c231add3f1186dd..e0d527262eb2c6fbd8111f29e958b022443ffdc1 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.h
+++ b/DynamicTablesPkg/Library/Common/AmlLib/AmlDbgPrint/AmlDbgPrint.h
@@ -45,7 +45,7 @@
**/
VOID
EFIAPI
-DumpRaw (
+AmlDbgDumpRaw (
IN CONST UINT8 * Ptr,
IN UINT32 Length
);
@@ -133,21 +133,45 @@ AmlDbgPrintNameSpace (
IN AML_ROOT_NODE_HANDLE RootNode
);
+/* Macros to encapsulate Aml Debug Print APIs.
+*/
+
+#define AMLDBG_DUMP_RAW(Ptr, Length) \
+ AmlDbgDumpRaw (Ptr, Length)
+
+#define AMLDBG_PRINT_CHARS(ErrorLevel, Buffer, Size) \
+ AmlDbgPrintChars (ErrorLevel, Buffer, Size)
+
+#define AMLDBG_PRINT_NAMESEG(Buffer) \
+ AmlDbgPrintNameSeg (Buffer)
+
+#define AMLDBG_PRINT_NAMESTR(Buffer,NewLine) \
+ AmlDbgPrintNameString (Buffer,NewLine)
+
+#define AMLDBG_PRINT_NODE(Node) \
+ AmlDbgPrintNode (Node)
+
+#define AMLDBG_PRINT_TREE(Node) \
+ AmlDbgPrintTree (Node)
+
+#define AMLDBG_PRINT_NAMESPACE(RootNode) \
+ AmlDbgPrintNameSpace (RootNode)
+
#else
-#define DumpRaw(Ptr, Length)
+#define AMLDBG_DUMP_RAW(Ptr, Length)
-#define AmlDbgPrintChars(ErrorLevel, Buffer, Size)
+#define AMLDBG_PRINT_CHARS(ErrorLevel, Buffer, Size)
-#define AmlDbgPrintNameSeg(Buffer)
+#define AMLDBG_PRINT_NAMESEG(Buffer)
-#define AmlDbgPrintNameString(Buffer,NewLine)
+#define AMLDBG_PRINT_NAMESTR(Buffer,NewLine)
-#define AmlDbgPrintNode(Node)
+#define AMLDBG_PRINT_NODE(Node)
-#define AmlDbgPrintTree(Node)
+#define AMLDBG_PRINT_TREE(Node)
-#define AmlDbgPrintNameSpace(RootNode)
+#define AMLDBG_PRINT_NAMESPACE(RootNode)
#endif // MDEPKG_NDEBUG
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/NameSpace/AmlNameSpace.c b/DynamicTablesPkg/Library/Common/AmlLib/NameSpace/AmlNameSpace.c
index 30d31572d379028a28d532c17092bef585959a50..2d055e9fb9645766a2f769b4aa304e91c2602107 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/NameSpace/AmlNameSpace.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/NameSpace/AmlNameSpace.c
@@ -1140,13 +1140,13 @@ AmlEnumeratePathCallback (
"Comparing search path with current node path.\n"
));
DEBUG ((DEBUG_VERBOSE, "Search path:"));
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_VERBOSE,
(CHAR8*)AmlStreamGetCurrPos (SearchPathBStream),
AmlStreamGetIndex (SearchPathBStream)
);
DEBUG ((DEBUG_VERBOSE, "\nPath of the current node: "));
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_VERBOSE,
(CHAR8*)AmlStreamGetCurrPos (CurrNodePathBStream),
AmlStreamGetIndex (CurrNodePathBStream)
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlFieldListParser.c b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlFieldListParser.c
index b9403efe3ca6f44712c91203c27410ec15eb3011..24460f9c8007a900a77f42ba8f718fd8fd5fbeab 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlFieldListParser.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlFieldListParser.c
@@ -82,7 +82,7 @@ AmlParseFieldElement (
}
// Skip the field opcode (1 byte) as it is already in the FieldByteEncoding.
- DumpRaw (CurrPos, 1);
+ AMLDBG_DUMP_RAW (CurrPos, 1);
Status = AmlStreamProgress (FStream, 1);
if (EFI_ERROR (Status)) {
ASSERT (0);
@@ -106,7 +106,7 @@ AmlParseFieldElement (
}
// Move stream forward as the PkgLen has been read.
- DumpRaw (CurrPos, PkgLenOffset);
+ AMLDBG_DUMP_RAW (CurrPos, PkgLenOffset);
Status = AmlStreamProgress (FStream, PkgLenOffset);
if (EFI_ERROR (Status)) {
ASSERT (0);
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlMethodParser.c b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlMethodParser.c
index 4797fa11edebc35628ef9c07a1feffff6b14a204..53e91dd6278bcfb5d0be9ff2c9a04db6d39ab57c 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlMethodParser.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlMethodParser.c
@@ -173,7 +173,7 @@ AmlDbgPrintNameSpaceRefList (
while (CurrLink != NameSpaceRefList) {
CurrNameSpaceNode = (AML_NAMESPACE_REF_NODE*)CurrLink;
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_INFO,
CurrNameSpaceNode->RawAbsolutePath,
CurrNameSpaceNode->RawAbsolutePathSize
@@ -749,7 +749,7 @@ AmlFindMethodDefinition (
}
DEBUG ((DEBUG_VERBOSE, "AmlMethodParser: Checking absolute name: "));
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_VERBOSE,
(CONST CHAR8*)AmlStreamGetCurrPos (RawAbsolutePathFStream),
AmlStreamGetMaxBufferSize (RawAbsolutePathFStream)
@@ -768,7 +768,7 @@ AmlFindMethodDefinition (
ProbedNameSpaceRefNode = (AML_NAMESPACE_REF_NODE*)NextLink;
// Print the raw absolute path of the probed node.
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_VERBOSE,
ProbedNameSpaceRefNode->RawAbsolutePath,
ProbedNameSpaceRefNode->RawAbsolutePathSize
@@ -1067,7 +1067,7 @@ AmlIsMethodInvocation (
DEBUG_VERBOSE,
"AmlMethodParser: Corresponding method definition: "
));
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_VERBOSE,
NameSpaceRefNode->RawAbsolutePath,
NameSpaceRefNode->RawAbsolutePathSize
@@ -1230,7 +1230,7 @@ AmlAddNameSpaceReference (
DEBUG_VERBOSE,
"AmlMethodParser: Adding namespace reference with name:\n"
));
- AmlDbgPrintChars (
+ AMLDBG_PRINT_CHARS (
DEBUG_VERBOSE,
(CONST CHAR8*)AmlStreamGetCurrPos (&RawAbsolutePathBStream),
AmlStreamGetIndex (&RawAbsolutePathBStream)
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c
index 4f6623de02d519e5345955603d0ce3f1056e4f17..e3b9f249058fee10a14a40a731159cb3c878957c 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c
@@ -182,7 +182,7 @@ AmlParseUIntX (
return Status;
}
- DumpRaw (AmlStreamGetCurrPos (FStream), UIntXSize);
+ AMLDBG_DUMP_RAW (AmlStreamGetCurrPos (FStream), UIntXSize);
// Move stream forward by the size of UIntX.
Status = AmlStreamProgress (FStream, UIntXSize);
@@ -266,7 +266,7 @@ AmlParseNameString (
return Status;
}
- DumpRaw (AmlStreamGetCurrPos (FStream), StrSize);
+ AMLDBG_DUMP_RAW (AmlStreamGetCurrPos (FStream), StrSize);
// Move the stream forward by StrSize.
Status = AmlStreamProgress (FStream, StrSize);
@@ -335,7 +335,7 @@ AmlParseString (
StrSize++;
} while (Byte != '\0');
- DumpRaw (Buffer, StrSize);
+ AMLDBG_DUMP_RAW (Buffer, StrSize);
Status = AmlCreateDataNode (
AmlTypeToNodeDataType (ExpectedFormat),
@@ -441,7 +441,7 @@ AmlParseObject (
}
// Print the opcode.
- DumpRaw (Buffer, OpCodeSize);
+ AMLDBG_DUMP_RAW (Buffer, OpCodeSize);
if (!IS_END_OF_STREAM (FStream)) {
// 3. Parse the PkgLength field, if present.
@@ -454,7 +454,7 @@ AmlParseObject (
}
// Print the package length.
- DumpRaw (Buffer, PkgOffset);
+ AMLDBG_DUMP_RAW (Buffer, PkgOffset);
// Adjust the size of the stream if it is valid package length.
FreeSpace = AmlStreamGetFreeSpace (FStream);
@@ -559,7 +559,7 @@ AmlParseFieldPkgLen (
return Status;
}
- DumpRaw (Buffer, PkgOffset);
+ AMLDBG_DUMP_RAW (Buffer, PkgOffset);
Status = AmlStreamProgress (FStream, PkgOffset);
if (EFI_ERROR (Status)) {
@@ -844,7 +844,7 @@ AmlParseByteList (
return Status;
}
- DumpRaw (Buffer, BufferSize);
+ AMLDBG_DUMP_RAW (Buffer, BufferSize);
// Move the stream forward as we have consumed the Buffer.
Status = AmlStreamProgress (FStream, BufferSize);
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlResourceDataParser.c b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlResourceDataParser.c
index 0f41c68b283794a577c551b0320afc5b6dcf55d7..7f78ed51bf2ef2acdd1c2448b2af8b9facfdf5a7 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlResourceDataParser.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlResourceDataParser.c
@@ -310,7 +310,7 @@ AmlParseResourceData (
return Status;
}
- DumpRaw (CurrRdElement, CurrRdElementSize);
+ AMLDBG_DUMP_RAW (CurrRdElement, CurrRdElementSize);
// Exit the loop when finding the resource data end tag.
if (AmlRdCompareDescId (
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
next prev parent reply other threads:[~2020-09-22 14:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 14:42 [PATCH v1 0/7] DynamicTablesPkg: Fix assert ordering and ECC reported issues Sami Mujawar
2020-09-22 14:42 ` [PATCH v1 1/7] DynamicTablesPkg: Fix order of assert checks Sami Mujawar
2020-09-22 15:06 ` [edk2-devel] " Alexei Fedorov
2020-09-22 14:42 ` [PATCH v1 2/7] DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error Sami Mujawar
2020-09-22 15:07 ` [edk2-devel] " Alexei Fedorov
2020-09-22 14:42 ` [PATCH v1 3/7] DynamicTablesPkg: AcpiSratLibArm " Sami Mujawar
2020-09-22 15:07 ` [edk2-devel] " Alexei Fedorov
2020-09-22 14:42 ` [PATCH v1 4/7] DynamicTablesPkg: AmlLib fix ECC errors Sami Mujawar
2020-09-22 15:07 ` [edk2-devel] " Alexei Fedorov
2020-09-22 14:42 ` Sami Mujawar [this message]
2020-09-22 15:07 ` [edk2-devel] [PATCH v1 5/7] DynamicTablesPkg: AmlLib\AmlDbgPrint fix ECC error Alexei Fedorov
2020-09-22 14:42 ` [PATCH v1 6/7] DynamicTablesPkg: AmlEncoding change debug macro Sami Mujawar
2020-09-22 15:07 ` [edk2-devel] " Alexei Fedorov
2020-09-22 14:42 ` [PATCH v1 7/7] DynamicTablesPkg: SsdtSerialPortFixupLib fix ECC errors Sami Mujawar
2020-09-22 15:08 ` [edk2-devel] " Alexei Fedorov
2020-09-22 15:08 ` [edk2-devel] [PATCH v1 0/7] DynamicTablesPkg: Fix assert ordering and ECC reported issues Alexei Fedorov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200922144235.76292-6-sami.mujawar@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox