From nobody Tue Feb 10 15:45:34 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+83932+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+83932+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1637665837; cv=none; d=zohomail.com; s=zohoarc; b=Il+b3CuaPK0yGjtqjvasFzE+w1kOk7mt5+peQWX0WAo0PcTKB90fX5HmlWlXKVUInL/AFQNe8mQFUtYrwM4amZNCCAIzKe0XxjbZuPZDDLriwP+HDKigPwibEwc6sfHXONL1WGyJzEKVrtxf5LmXTQ4N6JmRPUQOpJdx5FKMYMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637665837; 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=QTbXsx+VB1MqcyTrAQ9N2kCHvbolTOfN8iIjTJMCLJE=; b=fUycGr1S38jmEjXlUaNsiJIFL8eEVmiN9goD97K6Bk+PGaOc86WFZ9ym7/YLLFmsGSXhgkpxUu9fro2J5qa3lY/KT5i4YKVKNj8BMC72qGMF+xRtYycD6NK750zXQzWm0O0GFnt3k44cDdY/zMOFPNFS9NhsCYO9Q65cpoCy/zg= 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+83932+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 1637665837420883.5777172007066; Tue, 23 Nov 2021 03:10:37 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id jOEUYY1788612xTU0hyrkwXa; Tue, 23 Nov 2021 03:10:37 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9679.1637665835262425057 for ; Tue, 23 Nov 2021 03:10:35 -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 8F6CF150C; Tue, 23 Nov 2021 03:10:30 -0800 (PST) X-Received: from e126645.nice.arm.com (unknown [10.34.129.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A8AF83F5A1; Tue, 23 Nov 2021 03:10:29 -0800 (PST) From: "PierreGondois" To: pierre.gondois@arm.com, devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov Subject: [edk2-devel] [PATCH v2 2/5] DynamicTablesPkg: DynamicPlatRepo: Add TokenGenerator Date: Tue, 23 Nov 2021 12:10:07 +0100 Message-Id: <20211123111010.72679-3-Pierre.Gondois@arm.com> In-Reply-To: <20211123111010.72679-1-Pierre.Gondois@arm.com> References: <20211123111010.72679-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: fUvJxYFChyRwJo5jhTblwaYfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1637665837; bh=nEsGNhNviGp8mWhb/fs495RZxvWLJA6z/gWXRUR+ANE=; h=Cc:Date:From:Reply-To:Subject:To; b=n9Gz0wzcFrf4lKU57Nd7Ut98eRCsT2QaaW/jokmxmZDreW7i0xcMh/fllJWqimrhLWb nTlJRUdCMGhT3DR4fRK46riE+6fSNJSrN3ujowzg74XL0uNuTQRU6NeXqKmlU4n8O4Abi XJTssTZwuXOnbNgSpC346B2DOBAqu94Z/kk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1637665838304100001 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The DynamicPlatRepo library allows to handle dynamically created CmObj. The dynamic platform repository can be in the following states: 1 - Non-initialised 2 - Transient: Possibility to add CmObj to the platform, but not to query them. 3 - Finalised: Possibility to query CmObj, but not to add new. A token is allocated to each CmObj added to the dynamic platform repository (except for reference tokens CmObj). This allows to retrieve dynamic CmObjs among all CmObj (static CmObj for instance). This patch add the TokenGenerator files. Signed-off-by: Pierre Gondois --- .../DynamicPlatRepoLib/TokenGenerator.c | 28 +++++++++++++++++++ .../DynamicPlatRepoLib/TokenGenerator.h | 26 +++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/Toke= nGenerator.c create mode 100644 DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/Toke= nGenerator.h diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenera= tor.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenerator.c new file mode 100644 index 000000000000..637e784bd284 --- /dev/null +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenerator.c @@ -0,0 +1,28 @@ +/** @file + Token Generator + + Copyright (c) 2021, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Cm or CM - Configuration Manager + - Obj or OBJ - Object +**/ + +#include + +/** Generate a token. + + @return A token. +**/ +CM_OBJECT_TOKEN +EFIAPI +GenerateToken ( + VOID + ) +{ + // Start Tokens at 1 to avoid collisions with CM_NULL_TOKEN. + STATIC UINTN CurrentToken =3D 1; + return (CM_OBJECT_TOKEN)(CurrentToken++); +} diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenera= tor.h b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenerator.h new file mode 100644 index 000000000000..44d32e5b41a1 --- /dev/null +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenerator.h @@ -0,0 +1,26 @@ +/** @file + Token Generator + + Copyright (c) 2021, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Cm or CM - Configuration Manager + - Obj or OBJ - Object +**/ + +#ifndef TOKEN_GENERATOR_H_ +#define TOKEN_GENERATOR_H_ + +/** Generate a token. + + @return A token. +**/ +CM_OBJECT_TOKEN +EFIAPI +GenerateToken ( + VOID + ); + +#endif // TOKEN_GENERATOR_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 (#83932): https://edk2.groups.io/g/devel/message/83932 Mute This Topic: https://groups.io/mt/87256277/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-