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.4405.1665393679816561316 for ; Mon, 10 Oct 2022 02:21:19 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@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 A74CB1480; Mon, 10 Oct 2022 02:21:25 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.34.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B1BAC3F792; Mon, 10 Oct 2022 02:21:18 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov Subject: [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser Date: Mon, 10 Oct 2022 11:20:46 +0200 Message-Id: <20221010092058.118714-3-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221010092058.118714-1-Pierre.Gondois@arm.com> References: <20221010092058.118714-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois Add a PrintString to print strings in the CmObjParser. String must be NULL terminated and no buffer overrun check is done by this function. Signed-off-by: Pierre Gondois --- .../ConfigurationManagerObjectParser.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/Configuration= ManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/Co= nfigurationManagerObjectParser.c index 13e6c0e321c4..b46f19693bb5 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManager= ObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManager= ObjectParser.c @@ -19,6 +19,14 @@ PrintOemId ( UINT8 *Ptr ); =20 +STATIC +VOID +EFIAPI +PrintString ( + CONST CHAR8 *Format, + UINT8 *Ptr + ); + /** A parser for EArmObjBootArchInfo. */ STATIC CONST CM_OBJ_PARSER CmArmBootArchInfoParser[] =3D { @@ -646,6 +654,24 @@ PrintOemId ( )); } =20 +/** Print string. + + The string must be NULL terminated. + + @param [in] Format Format to print the Ptr. + @param [in] Ptr Pointer to the string. +**/ +STATIC +VOID +EFIAPI +PrintString ( + CONST CHAR8 *Format, + UINT8 *Ptr + ) +{ + DEBUG ((DEBUG_ERROR, "%a", Ptr)); +} + /** Print fields of the objects. =20 @param [in] Data Pointer to the object to print. --=20 2.25.1