Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicTablesPkg: Add HexDump for CM Object parser #5826

Closed
wants to merge 1 commit into from

Conversation

nvidia-dmach
Copy link
Contributor

Description

Add helper function HexDump for printing hex dump of CM Object fields.

Also merge multiple flavors of PrintCharX into one function PrintChars by using the field length.

  • Breaking change?
    • Breaking change - Will this cause a break in build or boot behavior?
    • Examples: Add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does the change have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Called ParseCmObjDesc() and ensured that "AcpiTableSignature", "OemTableId", "OemId[6]" fields were printed correctly. And HexDump was tested by dumping the 12 bytes of TPM2 "StartMethodParameters".

Integration Instructions

N/A

Add helper function HexDump for printing hex dump of CM Object fields.

Also merge multiple flavors of PrintCharX into one function PrintChars
by using the field length.

Signed-off-by: Dat Mach <dmach@nvidia.com>
@nvidia-dmach nvidia-dmach marked this pull request as draft June 25, 2024 21:01
PrintChar8 (
IN CONST CHAR8 *Format,
IN UINT8 *Ptr
HexDump (

Check notice

Code scanning / CodeQL

Unused static function Note

Static function HexDump is unreachable
));
UINT32 Index;

for (Index = 0; Index < Length; Index++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we set:

UINT32 Count;

Count = Length /  sizeof (UINT64);
for (...; Index < Count; ...)

and maybe rename the function PrintHexUint64 () as we are expecting to receive 64 bits values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Pierre,
Thanks for reviewing.

Actually, I meant to add this HexDump function to dump arbitrary length array. Later, I found this patch had dependency on other patches. Hence, I have made another PR: #5827. Could you please review 5827 instead?

Sorry, I am new to this and will find a way to abandon this PR.

@nvidia-dmach
Copy link
Contributor Author

Closing this PR. I have opened another PR with more patches. Please review #5827 instead. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants