From nobody Tue Feb 10 04:14:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+63585+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63585+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1596212380; cv=none; d=zohomail.com; s=zohoarc; b=UZ9wCnu0XHgI/sdymHyh/WJ9yPa5zB2Ze9PZG/MNHbkJs2F1mOOkwB73vHTsdw9eB9WV/4WvaLyC00UNyqMH6C6sU0mAOkSfKOQGXSIWsi1yV9LcE3iRktWLxmjVyp+mSv+tFimMFNnncxr1RXvjceYS0GU+fgj0Zgj7+Yx67nc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596212380; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=smuDwY+OJ0EaDkggZc8dXYc3IhZTiBRdZo23WGZhiHw=; b=DFfuLEgn2bddLtHqoS7ZBx7INQ6KXUqGlbXlBXWCzTyUFJqajzY89aVQ8lnOZ/WLXUxwNOGKH7IC5U/FZjBliCpcIfQxm7rVR03MB9rf79HCSEPJexUrGhu0yUx4ErT6v1aUPnzwSb60gOLKbFImilh9cnbbKKiuUiIzQSV72m0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63585+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1596212380806669.7183881255341; Fri, 31 Jul 2020 09:19:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iyX9YY1788612xJjgqdrIOsd; Fri, 31 Jul 2020 09:19:40 -0700 X-Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web10.443.1596212377223021177 for ; Fri, 31 Jul 2020 09:19:37 -0700 X-Received: by mail-wm1-f47.google.com with SMTP id c80so8990358wme.0 for ; Fri, 31 Jul 2020 09:19:37 -0700 (PDT) X-Gm-Message-State: PTsmHQkOHO95yl9yOfx8gyHtx1787277AA= X-Google-Smtp-Source: ABdhPJzr8OAWTjUH0O/JtsZZy2yv+P6G3YVQzKT23ErZqP8c/lBGRt/EniFrnCfm99vJLrkJUk3zgg== X-Received: by 2002:a1c:4e17:: with SMTP id g23mr4425239wmh.42.1596212374992; Fri, 31 Jul 2020 09:19:34 -0700 (PDT) X-Received: from localhost.localdomain (cpc159317-cmbg20-2-0-cust162.5-4.cable.virginm.net. [81.111.29.163]) by smtp.gmail.com with ESMTPSA id v11sm14149739wrr.10.2020.07.31.09.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 09:19:34 -0700 (PDT) From: "Tomas Pilar (tpilar)" To: devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov Subject: [edk2-devel] [PATCH 6/8] DynamicTablesPkg/TableHelperLib: User friendly strings Date: Fri, 31 Jul 2020 17:19:24 +0100 Message-Id: <20200731161926.341330-7-tomas@nuviainc.com> In-Reply-To: <20200731161926.341330-1-tomas@nuviainc.com> References: <20200731161926.341330-1-tomas@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,tomas@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596212380; bh=fvo6fopzjqIsLHvswZxPKMQCx9UJuG4Q9Z6EfjlvXkk=; h=Cc:Date:From:Reply-To:Subject:To; b=qneEoUBfKEXGVHXFPnv74glcD/XXEYsQHR4fKZ95YaJjMi4yJVxSJ+qi4/FEmTGZS75 EZH7y3rQVg70UqlLrMN0oOKrHqLhIPFZQxYwKWocHLaEFNEZ5KSGaCoNlBzMVBD8Jvscy EKdMFUkYo4xqDs5BxFl4d5KoiuvFo1eK/MQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add user friendly strings for CmObjectIds to TableHelperLib and add debug print invocations to common helper methods. Cc: Sami Mujawar Cc: Alexei Fedorov Signed-off-by: Tomas Pilar --- .../ConfigurationManagerDumpApp.c | 13 +-- .../ConfigurationManagerDumpApp.h | 8 -- .../ConfigurationManagerDumpApp.inf | 3 +- .../ConfigurationObjectStrings.c | 50 ---------- .../Include/Library/TableHelperLib.h | 12 +++ .../ConfigurationObjectStrings.c | 92 +++++++++++++++++++ .../Common/TableHelperLib/TableHelperLib.inf | 1 + 7 files changed, 109 insertions(+), 70 deletions(-) delete mode 100644 DynamicTablesPkg/Applications/ConfigurationManagerDumpA= pp/ConfigurationManagerDumpApp.h delete mode 100644 DynamicTablesPkg/Applications/ConfigurationManagerDumpA= pp/ConfigurationObjectStrings.c create mode 100644 DynamicTablesPkg/Library/Common/TableHelperLib/Configur= ationObjectStrings.c diff --git a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Conf= igurationManagerDumpApp.c b/DynamicTablesPkg/Applications/ConfigurationMana= gerDumpApp/ConfigurationManagerDumpApp.c index 15936c78c1..20977c1b82 100644 --- a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Configurati= onManagerDumpApp.c +++ b/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Configurati= onManagerDumpApp.c @@ -1,10 +1,9 @@ #include #include #include +#include #include =20 -#include "ConfigurationManagerDumpApp.h" - EDKII_CONFIGURATION_MANAGER_PROTOCOL *mCfgMgr; =20 EFI_STATUS @@ -33,10 +32,7 @@ UefiMain( continue; } =20 - Print ( - L"<%s>::<%s>\n", - ObjectNameSpaceString[EObjNameSpaceStandard], - StdObjectString[ObjectId - EObjNameSpaceStandard]); + Print (L"<%s>\n", CmObjectIdName (ObjectId)); =20 Print ( L"Id=3D%x Size=3D0x%x at=3D%p count=3D%d\n", @@ -54,10 +50,7 @@ UefiMain( continue; } =20 - Print ( - L"<%s>::<%s>\n", - ObjectNameSpaceString[EObjNameSpaceArm], - ArmObjectString[ObjectId - EObjNameSpaceArm]); + Print (L"<%s>\n", CmObjectIdName(ObjectId)); =20 Print ( L"Id=3D%x Size=3D0x%x at=3D%p count=3D%d\n", diff --git a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Conf= igurationManagerDumpApp.h b/DynamicTablesPkg/Applications/ConfigurationMana= gerDumpApp/ConfigurationManagerDumpApp.h deleted file mode 100644 index 5017d55b4a..0000000000 --- a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Configurati= onManagerDumpApp.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIGURATION_MANAGER_DUMP_APP_H_ -#define CONFIGURATION_MANAGER_DUMP_APP_H_ - -extern CHAR16 *ArmObjectString[]; -extern CHAR16 *ObjectNameSpaceString[]; -extern CHAR16 *StdObjectString[]; - -#endif diff --git a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Conf= igurationManagerDumpApp.inf b/DynamicTablesPkg/Applications/ConfigurationMa= nagerDumpApp/ConfigurationManagerDumpApp.inf index 9f8beb916d..f930ca3dcb 100644 --- a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Configurati= onManagerDumpApp.inf +++ b/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Configurati= onManagerDumpApp.inf @@ -23,8 +23,6 @@ =20 [Sources] ConfigurationManagerDumpApp.c - ConfigurationManagerDumpApp.h - ConfigurationObjectStrings.c =20 [Packages] MdePkg/MdePkg.dec @@ -32,6 +30,7 @@ DynamicTablesPkg/DynamicTablesPkg.dec =20 [LibraryClasses] + TableHelperLib UefiLib UefiBootServicesTableLib UefiApplicationEntryPoint diff --git a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Conf= igurationObjectStrings.c b/DynamicTablesPkg/Applications/ConfigurationManag= erDumpApp/ConfigurationObjectStrings.c deleted file mode 100644 index ad8dbb6354..0000000000 --- a/DynamicTablesPkg/Applications/ConfigurationManagerDumpApp/Configurati= onObjectStrings.c +++ /dev/null @@ -1,50 +0,0 @@ - -CHAR16 *ArmObjectString[] =3D { - L"Reserved", - L"Boot Architecture Info", - L"CPU Info", - L"Power Management Profile Info", - L"GIC CPU Interface Info", - L"GIC Distributor Info", - L"GIC MSI Frame Info", - L"GIC Redistributor Info", - L"GIC ITS Info", - L"Serial Console Port Info", - L"Serial Debug Port Info", - L"Generic Timer Info", - L"Platform GT Block Info", - L"Generic Timer Block Frame Info", - L"Platform Generic Watchdog", - L"PCI Configuration Space Info", - L"Hypervisor Vendor Id", - L"Fixed feature flags for FADT", - L"ITS Group", - L"Named Component", - L"Root Complex", - L"SMMUv1 or SMMUv2", - L"SMMUv3", - L"PMCG", - L"GIC ITS Identifier Array", - L"ID Mapping Array", - L"SMMU Interrupt Array", - L"Processor Hierarchy Info", - L"Cache Info", - L"Processor Node ID Info", - L"CM Object Reference", - L"Memory Affinity Info", - L"Device Handle Acpi", - L"Device Handle Pci", - L"Generic Initiator Affinity" -}; - -CHAR16 *ObjectNameSpaceString[] =3D { - L"Standard Objects Namespace", - L"ARM Objects Namespace", - L"OEM Objects Namespace" -}; - -CHAR16 *StdObjectString[] =3D { - L"Configuration Manager Info", - L"ACPI table Info List", - L"SMBIOS table Info List" -}; diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h b/DynamicTab= lesPkg/Include/Library/TableHelperLib.h index 0d3d1bbd60..9269e77377 100644 --- a/DynamicTablesPkg/Include/Library/TableHelperLib.h +++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h @@ -24,6 +24,18 @@ UINTN EFIAPI GetNewToken(); =20 +/** + Returns the user friendly name for the given ObjectId. + + @param[in] CmObjectId The id of the configuration manager object + @return User friendly name for object id. +**/ +const CHAR16* +EFIAPI +CmObjectIdName( + IN CONST CM_OBJECT_ID CmObjectrId + ); + /** Return the count of objects of a given ObjectId. =20 diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationOb= jectStrings.c b/DynamicTablesPkg/Library/Common/TableHelperLib/Configuratio= nObjectStrings.c new file mode 100644 index 0000000000..e4c0e77633 --- /dev/null +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationObjectStr= ings.c @@ -0,0 +1,92 @@ +/** @file + ConfigurationObjectStrings.c + + Copyright (c) 2020, ARM Limited. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +const CHAR16 *ArmObjectString[] =3D { + L"Reserved", + L"Boot Architecture Info", + L"CPU Info", + L"Power Management Profile Info", + L"GIC CPU Interface Info", + L"GIC Distributor Info", + L"GIC MSI Frame Info", + L"GIC Redistributor Info", + L"GIC ITS Info", + L"Serial Console Port Info", + L"Serial Debug Port Info", + L"Generic Timer Info", + L"Platform GT Block Info", + L"Generic Timer Block Frame Info", + L"Platform Generic Watchdog", + L"PCI Configuration Space Info", + L"Hypervisor Vendor Id", + L"Fixed feature flags for FADT", + L"ITS Group", + L"Named Component", + L"Root Complex", + L"SMMUv1 or SMMUv2", + L"SMMUv3", + L"PMCG", + L"GIC ITS Identifier Array", + L"ID Mapping Array", + L"SMMU Interrupt Array", + L"Processor Hierarchy Info", + L"Cache Info", + L"Processor Node ID Info", + L"CM Object Reference", + L"Memory Affinity Info", + L"Device Handle Acpi", + L"Device Handle Pci", + L"Generic Initiator Affinity" +}; + +const CHAR16 *ObjectNameSpaceString[] =3D { + L"Standard Objects Namespace", + L"ARM Objects Namespace", + L"OEM Objects Namespace" +}; + +const CHAR16 *StdObjectString[] =3D { + L"Configuration Manager Info", + L"ACPI table Info List", + L"SMBIOS table Info List" +}; + +const CHAR16* UnknownObject =3D L"Unknown Object"; + +/** + Returns the user friendly name for the given ObjectId. + + @param[in] CmObjectId The id of the configuration manager object + @return User friendly name for object id. +**/ +const CHAR16* +EFIAPI +CmObjectIdName( + IN CONST CM_OBJECT_ID CmObjectId + ) +{ + switch (GET_CM_NAMESPACE_ID(CmObjectId)) { + case EObjNameSpaceStandard: + if (CmObjectId < EStdObjMax) { + return StdObjectString[CmObjectId - EObjNameSpaceStandard]; + } else { + return UnknownObject; + } + case EObjNameSpaceArm: + if (CmObjectId < EArmObjMax) { + return ArmObjectString[CmObjectId - EObjNameSpaceArm]; + } else { + return UnknownObject; + } + default: + return UnknownObject; + } + + return UnknownObject; +} diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.= inf b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf index e12380073e..0fbc1fe5b2 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf @@ -16,6 +16,7 @@ =20 [Sources] TableHelper.c + ConfigurationObjectStrings.c =20 [Packages] MdePkg/MdePkg.dec --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#63585): https://edk2.groups.io/g/devel/message/63585 Mute This Topic: https://groups.io/mt/75910570/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-