From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5B119941E23 for ; Mon, 8 Jul 2024 21:39:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3InqRAL9qiWIlt21tBzuuXaQkfyH9SS0M6YugQsWK04=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1720474779; v=1; b=COBy1aE3TvcdQWSy0ga4IM/jzmDz3q65ETm+W/WvMqxoUjHcr+qQBevRJBvahm07boL5i1a+ GnzUihm4DvnncyGS/M2e3NzQe95MhV5e1l4BwIBCTlE6JseRJN/CM8CSxjYqs8jGcvAxET9Fha3 o6x6xqZMfID2BKH34KiTyeZ0t/fPuYiWt2h6wiB85VNMGLuFDzwGK8hY5Z7bzz2LUtMGs+hDWpU 4Igs+7j8pKJnBRrK1IKP2NTF5wA2LWAo/ZnPrePUmf3xQqv4M6lD0MvJYa++lhK7aEHhPdfIu+7 bt5CLDR5QLyI0HC31rc9fMn1WPpIVxUVdq141ESBj53FA== X-Received: by 127.0.0.2 with SMTP id Q3baYY7687511x0qFgnzBMnM; Mon, 08 Jul 2024 14:39:37 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5753.1720474777403112227 for ; Mon, 08 Jul 2024 14:39:37 -0700 X-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 B98B1139F; Mon, 8 Jul 2024 14:40:01 -0700 (PDT) X-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 7C6E43F641; Mon, 8 Jul 2024 14:39:35 -0700 (PDT) From: "Rohit Mathew" To: devel@edk2.groups.io Cc: James Morse , Sami Mujawar , Thomas Abraham , Zhichao Gao , Pierre Gondois Subject: [edk2-devel] [PATCH V6 4/6] ShellPkg: acpiview: Add routine to print 16 chars Date: Mon, 8 Jul 2024 22:39:32 +0100 Message-Id: <20240708213932.41530-1-rohit.mathew@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 08 Jul 2024 14:39:37 -0700 Resent-From: rohit.mathew@arm.com Reply-To: devel@edk2.groups.io,rohit.mathew@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: fsroNFoPHGG9mf9jmyAfC2Cdx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=COBy1aE3; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Rohit Mathew 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 Cc: James Morse Cc: Sami Mujawar Cc: Thomas Abraham Cc: Zhichao Gao Reviewed-by: Pierre Gondois Reviewed-by: Zhichao Gao Reviewed-by: Sami Mujawar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 39 +++++++++= +++++++++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 18 +++++++++ 2 files changed, 57 insertions(+) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/= ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index beb58c72a9..5fd7fd7a3d 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -459,6 +459,45 @@ 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. + @param [in] Length Length of the field. +**/ +VOID +EFIAPI +Dump16Chars ( + IN CONST CHAR16 *Format OPTIONAL, + IN UINT8 *Ptr, + IN UINT32 Length + ) +{ + 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 2b7b847e22..e1ed543468 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h @@ -212,6 +212,24 @@ Dump12Chars ( IN UINT32 Length ); =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. + @param [in] Length Length of the field. +**/ +VOID +EFIAPI +Dump16Chars ( + IN CONST CHAR16 *Format OPTIONAL, + IN UINT8 *Ptr, + IN UINT32 Length + ); + /** This function indents and prints the ACPI table Field Name. =20 --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119820): https://edk2.groups.io/g/devel/message/119820 Mute This Topic: https://groups.io/mt/107112186/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-