From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.23869.1684766698796721110 for ; Mon, 22 May 2023 07:44:59 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: rohit.mathew@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5097D11FB; Mon, 22 May 2023 07:45:43 -0700 (PDT) Received: from usa.arm.com (iss-desktop03.cambridge.arm.com [10.1.196.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6D42F3F67D; Mon, 22 May 2023 07:44:57 -0700 (PDT) From: "Rohit Mathew" To: devel@edk2.groups.io Cc: Thomas Abraham , Sami Mujawar , James Morse , Ray Ni , Zhichao Gao Subject: [PATCH V3 2/3] ShellPkg: acpiview: Add routine to print 16 chars Date: Mon, 22 May 2023 15:44:54 +0100 Message-Id: <20230522144454.2799102-1-Rohit.Mathew@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Certain ACPI tables like MPAM has fields which are 16 bytes long. Routines similar to Dump12Chars but for 16 characters are required to print such fields. Add Dump16Chars routine to satisfy this requirement. Signed-off-by: Rohit Mathew --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 39 +++++++++= ++++++++++- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 18 ++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/= ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index eac9286176..87f55098b8 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -1,7 +1,7 @@ /** @file ACPI parser =20 - Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. + Copyright (c) 2016 - 2023, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -449,6 +449,43 @@ Dump12Chars ( ); } =20 +/** + This function traces 16 characters which can be optionally + formated using the format string if specified. + + If no format string is specified the Format must be NULL. + + @param [in] Format Optional format string for tracing the data. + @param [in] Ptr Pointer to the start of the buffer. +**/ +VOID +EFIAPI +Dump16Chars ( + IN CONST CHAR16 *Format OPTIONAL, + IN UINT8 *Ptr + ) +{ + Print ( + (Format !=3D NULL) ? Format : L"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", + Ptr[0], + Ptr[1], + Ptr[2], + Ptr[3], + Ptr[4], + Ptr[5], + Ptr[6], + Ptr[7], + Ptr[8], + Ptr[9], + Ptr[10], + Ptr[11], + Ptr[12], + Ptr[13], + Ptr[14], + Ptr[15] + ); +} + /** This function indents and prints the ACPI table Field Name. =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/= ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h index 4b4397961b..c9f41650d9 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h @@ -2,7 +2,7 @@ Header file for ACPI parser =20 Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. - Copyright (c) 2016 - 2020, Arm Limited. All rights reserved. + Copyright (c) 2016 - 2023, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -202,6 +202,22 @@ Dump12Chars ( IN UINT8 *Ptr ); =20 +/** + This function traces 16 characters which can be optionally + formated using the format string if specified. + + If no format string is specified the Format must be NULL. + + @param [in] Format Optional format string for tracing the data. + @param [in] Ptr Pointer to the start of the buffer. +**/ +VOID +EFIAPI +Dump16Chars ( + IN CONST CHAR16 *Format OPTIONAL, + IN UINT8 *Ptr + ); + /** This function indents and prints the ACPI table Field Name. =20 --=20 2.34.1