From nobody Tue Feb 10 05:41:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84586+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84586+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1639042336; cv=none; d=zohomail.com; s=zohoarc; b=a+9qhXflQJ/id+t7oWuhl2PXDfnSt0CxncWujveh/rhv0Znp8bt6zQSuEKk9qWqM6ZORh0RbOcbVPDuDD55hjFInkPsjeyARvF0OXbpOyD2VGu1VC9aJXaQze2z20RLAmJ3bo8bJi4RORlZyD3UQuiaPfEVtkC8uC1vqZ8yns+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639042336; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Z8SBKSSL+rXouvK0dYmHTt3lXpE7SckSwgwFJ3n72DQ=; b=RzIBXUKWJTHyxn/eHuz7iTGtjV+w8Mzlxm99waFxRd4xu91uBuGu3I8l14WNTOFy2jgouYENIY9Cu5V9NEGN6ZAS+smbqyZ8v0cYFFQPAMTWABvmsnJ4+KhoAmWEIfjAn4zCYdX8uOK5IQkEQyI2w18m+DOxPujXc/CDZrsvz0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84586+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1639042336465725.4901464772928; Thu, 9 Dec 2021 01:32:16 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id gpx0YY1788612x2KyaM0NOIt; Thu, 09 Dec 2021 01:32:16 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.9302.1639042335507913625 for ; Thu, 09 Dec 2021 01:32:15 -0800 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 EB42211FB; Thu, 9 Dec 2021 01:32:14 -0800 (PST) X-Received: from e126645.nice.arm.com (unknown [10.34.129.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E811D3F73B; Thu, 9 Dec 2021 01:32:13 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov Subject: [edk2-devel] [PATCH v4 01/15] DynamicTablesPkg: Definition for HwInfoParser interface Date: Thu, 9 Dec 2021 10:31:54 +0100 Message-Id: <20211209093208.1249257-2-Pierre.Gondois@arm.com> In-Reply-To: <20211209093208.1249257-1-Pierre.Gondois@arm.com> References: <20211209093208.1249257-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,pierre.gondois@arm.com X-Gm-Message-State: Ir22oRwwr6DKXGgrGZnYSkHwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639042336; bh=0PD8I84ttG/S7J+QqVcv0lPe+FLaqdXXv0MP52Kc8SQ=; h=Cc:Date:From:Reply-To:Subject:To; b=ox2+RAMYLdXcFn8xrUOhPjpg4pCD64iwYRo2yTPkB/FFSt7m0unpL5BSSYN4CMaH1E9 I5CoUNA59JHiQcmw3njfS3bfmDKVZwHxz1nkimXc9ebGf6bVV+ga7YBhtssld6c1pdjd1 Lg73CU95INv+iIl1JV9ZHx9Y3IAJqSvkwnI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639042336804100005 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois Hardware information parser is an optional module defined by the Dynamic Tables Framework. It can either parse an XML, a Device Tree or a Json file containing the platform hardware information to populate the platform information repository. The Configuration Manager can then utilise this information to generate ACPI tables for the platform. Therefore, define an interface for the HwInfoParser library class. Signed-off-by: Pierre Gondois Co-authored-by: Sami Mujawar Reviewed-by: Joey Gouly --- DynamicTablesPkg/DynamicTablesPkg.dec | 3 + .../Include/Library/HwInfoParserLib.h | 99 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 DynamicTablesPkg/Include/Library/HwInfoParserLib.h diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/Dynam= icTablesPkg.dec index 9996bdf6f520..80a61dd2dbac 100644 --- a/DynamicTablesPkg/DynamicTablesPkg.dec +++ b/DynamicTablesPkg/DynamicTablesPkg.dec @@ -24,6 +24,9 @@ [LibraryClasses] ## @libraryclass Defines a set of APIs for Dynamic AML generation. AmlLib|Include/Library/AmlLib/AmlLib.h =20 + ## @libraryclass Defines a set of APIs to a hardware information parse= r. + HwInfoParserLib|Include/Library/HwInfoParserLib.h + ## @libraryclass Defines a set of methods for fixing up a SSDT Serial = Port. SsdtSerialPortFixupLib|Include/Library/SsdtSerialPortFixupLib.h =20 diff --git a/DynamicTablesPkg/Include/Library/HwInfoParserLib.h b/DynamicTa= blesPkg/Include/Library/HwInfoParserLib.h new file mode 100644 index 000000000000..05c21aeac00a --- /dev/null +++ b/DynamicTablesPkg/Include/Library/HwInfoParserLib.h @@ -0,0 +1,99 @@ +/** @file + Hardware information parser library. + + Copyright (c) 2021, ARM Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef HW_INFO_PARSER_LIB_H_ +#define HW_INFO_PARSER_LIB_H_ + +#include + +/** A handle to the HwInfoParser instance. +*/ +typedef VOID *HW_INFO_PARSER_HANDLE; + +/** Function pointer called by the parser to add information. + + Callback function that the parser can use to add new + CmObj. This function must copy the CmObj data and not rely on + the parser preserving the CmObj memory. + This function is responsible of the Token allocation. + + @param [in] ParserHandle A handle to the parser instance. + @param [in] Context A pointer to the caller's context provided in + HwInfoParserInit (). + @param [in] CmObjDesc CM_OBJ_DESCRIPTOR containing the CmObj(s) to= add. + @param [out] Token If provided and success, contain the token + generated for the CmObj. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +typedef +EFI_STATUS +(EFIAPI *HW_INFO_ADD_OBJECT)( + IN HW_INFO_PARSER_HANDLE ParserHandle, + IN VOID *Context, + IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc, + OUT CM_OBJECT_TOKEN *Token OPTIONAL + ); + +/** Initialise the HwInfoParser. + + The HwInfoParser shall use the information provided by the HwDataSource + to initialise the internal state of the parser or to index the data. This + internal state shall be linked to the ParserHandle using an implementati= on + defined mechanism. + + @param [in] HwDataSource Pointer to the blob containing the hardware + information. It can be a pointer to a Devi= ce + Tree, an XML file, etc. or any other data + structure defined by the HwInfoParser. + @param [in] Context A pointer to the caller's context. + @param [in] HwInfoAdd Function pointer called by the parser when + adding information. + @param [out] ParserHandle A handle to the parser instance. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +HwInfoParserInit ( + IN VOID *HwDataSource, + IN VOID *Context, + IN HW_INFO_ADD_OBJECT HwInfoAdd, + OUT HW_INFO_PARSER_HANDLE *ParserHandle + ); + +/** Parse the data provided by the HwDataSource. + + @param [in] ParserHandle A handle to the parser instance. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES An allocation has failed. +**/ +EFI_STATUS +EFIAPI +HwInfoParse ( + IN HW_INFO_PARSER_HANDLE ParserHandle + ); + +/** Cleanup any internal state and resources that were allocated + by the the HwInfoParser. + + @param [in] ParserHandle A handle to the parser instance. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +HwInfoParserShutdown ( + IN HW_INFO_PARSER_HANDLE ParserHandle + ); + +#endif // HW_INFO_PARSER_LIB_H_ --=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 (#84586): https://edk2.groups.io/g/devel/message/84586 Mute This Topic: https://groups.io/mt/87608902/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-