summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/KvmtoolCfgMgrDxe
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2024-03-07 13:31:39 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-29 13:44:55 +0000
commit6dad45b7dd1eeeee633d5628d2dfe8b83ac04413 (patch)
treeddbf3abb3a1c0e17f3470bba123afb83054e74fb /ArmVirtPkg/KvmtoolCfgMgrDxe
parent58c36ce09f677a2e14681d3baf19753e86c6c103 (diff)
downloadedk2-6dad45b7dd1eeeee633d5628d2dfe8b83ac04413.tar.gz
edk2-6dad45b7dd1eeeee633d5628d2dfe8b83ac04413.tar.bz2
edk2-6dad45b7dd1eeeee633d5628d2dfe8b83ac04413.zip
ArmVirtPkg: Kvmtool: Update ConfigMgr to support ArchCommon
Update the Configuration Manager for Kvmtool guest firmware to handle ArchComm namespace objects. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Diffstat (limited to 'ArmVirtPkg/KvmtoolCfgMgrDxe')
-rw-r--r--ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c b/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c
index 68b9d2bf05..4a76583f96 100644
--- a/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c
+++ b/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c
@@ -723,6 +723,73 @@ GetStandardNameSpaceObject (
}
/**
+ Return an ArchCommon namespace object.
+
+ @param [in] This Pointer to the Configuration Manager Protocol.
+ @param [in] CmObjectId The Configuration Manager Object ID.
+ @param [in] Token An optional token identifying the object. If
+ unused this must be CM_NULL_TOKEN.
+ @param [in, out] CmObject Pointer to the Configuration Manager Object
+ descriptor describing the requested Object.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_NOT_FOUND The required object information is not found.
+**/
+EFI_STATUS
+EFIAPI
+GetArchCommonNameSpaceObject (
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST This,
+ IN CONST CM_OBJECT_ID CmObjectId,
+ IN CONST CM_OBJECT_TOKEN Token OPTIONAL,
+ IN OUT CM_OBJ_DESCRIPTOR *CONST CmObject
+ )
+{
+ EFI_STATUS Status;
+ EDKII_PLATFORM_REPOSITORY_INFO *PlatformRepo;
+
+ if ((This == NULL) || (CmObject == NULL)) {
+ ASSERT (This != NULL);
+ ASSERT (CmObject != NULL);
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Status = EFI_NOT_FOUND;
+ PlatformRepo = This->PlatRepoInfo;
+
+ //
+ // First check among the static objects.
+ //
+ switch (GET_CM_OBJECT_ID (CmObjectId)) {
+ default:
+ //
+ // No match found among the static objects.
+ // Check the dynamic objects.
+ //
+ Status = DynamicPlatRepoGetObject (
+ PlatformRepo->DynamicPlatformRepo,
+ CmObjectId,
+ Token,
+ CmObject
+ );
+ break;
+ } // switch
+
+ if (Status == EFI_NOT_FOUND) {
+ DEBUG ((
+ DEBUG_INFO,
+ "INFO: CmObjectId " FMT_CM_OBJECT_ID ". Status = %r\n",
+ CmObjectId,
+ Status
+ ));
+ } else {
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ return Status;
+}
+
+/**
Return an ARM namespace object.
@param [in] This Pointer to the Configuration Manager Protocol.
@@ -929,6 +996,9 @@ ArmKvmtoolPlatformGetObject (
case EObjNameSpaceStandard:
Status = GetStandardNameSpaceObject (This, CmObjectId, Token, CmObject);
break;
+ case EObjNameSpaceArchCommon:
+ Status = GetArchCommonNameSpaceObject (This, CmObjectId, Token, CmObject);
+ break;
case EObjNameSpaceArm:
Status = GetArmNameSpaceObject (This, CmObjectId, Token, CmObject);
break;