summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2021-12-09 10:32:51 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-14 18:45:19 +0000
commit38f6d78c3b62f8825e7d802697b7992418a72da7 (patch)
tree7ff79c4d146bd2ac269ddcf1f2fba2fefd23176b /DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h
parent5fe5b6f94fd3b8717b0418bf68ccd1f3323cb498 (diff)
downloadedk2-38f6d78c3b62f8825e7d802697b7992418a72da7.tar.gz
edk2-38f6d78c3b62f8825e7d802697b7992418a72da7.tar.bz2
edk2-38f6d78c3b62f8825e7d802697b7992418a72da7.zip
DynamicTablesPkg: Add DynamicPlatRepo library
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 inf file of the module and the main module functionnalities and update the dsc file of the package. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h')
-rw-r--r--DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h
new file mode 100644
index 0000000000..eaee5d4ce9
--- /dev/null
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoInternal.h
@@ -0,0 +1,78 @@
+/** @file
+ Dynamic Platform Info Repository Internal
+
+ Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Glossary:
+ - Cm or CM - Configuration Manager
+ - Obj or OBJ - Object
+**/
+
+#ifndef DYNAMIC_PLAT_REPO_INTERNAL_H_
+#define DYNAMIC_PLAT_REPO_INTERNAL_H_
+
+#include "TokenMapper.h"
+
+#pragma pack(1)
+
+/** CmObj node.
+
+ This is a node wrapper around the CM_OBJ_DESCRIPTOR structure.
+ It also allows to bind a token to the CM_OBJ_DESCRIPTOR.
+*/
+typedef struct CmObjectNode {
+ /// This must be the first field in this structure.
+ LIST_ENTRY Link;
+
+ /// Token associated with the CmObjDesc.
+ CM_OBJECT_TOKEN Token;
+
+ /// CmObjDesc wrapped.
+ /// Note: the CM_OBJ_DESCRIPTOR.Data field is allocated and copied.
+ CM_OBJ_DESCRIPTOR CmObjDesc;
+} CM_OBJ_NODE;
+
+/** Dynamic repository states.
+
+ The states must progress as:
+ UnInitialised -> Transient -> Finalized
+*/
+typedef enum DynRepoState {
+ DynRepoUnInitialised, ///< Un-Initialised state
+ DynRepoTransient, ///< Transient state - CmObjects can be added.
+ DynRepoFinalized, ///< Repo Locked - No further CmObjects can be added.
+ ///< Getting objects is now possible.
+ DynRepoMax ///< Max value.
+} EDYNAMIC_REPO_STATE;
+
+/** A structure describing the platform configuration
+ manager repository information
+*/
+typedef struct DynamicPlatformRepositoryInfo {
+ /// Repo state machine.
+ EDYNAMIC_REPO_STATE RepoState;
+
+ /// Count of all the objects added to the Dynamic Platform Repo
+ /// during the Transient state.
+ UINTN ObjectCount;
+
+ /// Link lists of CmObj from the ArmNameSpace
+ /// that are added in the Transient state.
+ LIST_ENTRY ArmCmObjList[EArmObjMax];
+
+ /// Structure Members used in Finalized state.
+ /// An array of CmObj Descriptors from the ArmNameSpace
+ /// This array is populated when the Repo is finalized.
+ CM_OBJ_DESCRIPTOR ArmCmObjArray[EArmObjMax];
+
+ /// A token mapper for the objects in the ArmNamespaceObjectArray
+ /// The Token mapper is populated when the Repo is finalized in
+ /// a call to DynamicPlatRepoFinalise ().
+ TOKEN_MAPPER TokenMapper;
+} DYNAMIC_PLATFORM_REPOSITORY_INFO;
+
+#pragma pack()
+
+#endif // DYNAMIC_PLAT_REPO_INTERNAL_H_