From: Sami Mujawar <sami.muja...@arm.com>

Update the Configuration Manager for Kvmtool guest firmware
to handle ArchComm namespace objects.

Cc: Pierre Gondois <pierre.gond...@arm.com>
Cc: Yeo Reum Yun <yeoreum....@arm.com>
Cc: AbdulLateef Attar <abdullateef.at...@amd.com>
Cc: Jeshua Smith <jesh...@nvidia.com>
Cc: Jeff Brasen <jbra...@nvidia.com>
Cc: Girish Mahadevan <gmahade...@nvidia.com>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Cc: Meenakshi Aggarwal <meenakshi.aggar...@nxp.com>
Signed-off-by: Sami Mujawar <sami.muja...@arm.com>
Signed-off-by: Pierre Gondois <pierre.gond...@arm.com>
---
 .../KvmtoolCfgMgrDxe/ConfigurationManager.c   | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c 
b/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c
index 68b9d2bf0513..4a76583f969c 100644
--- a/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c
+++ b/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c
@@ -722,6 +722,73 @@ GetStandardNameSpaceObject (
   return Status;
 }
 
+/**
+  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.
 
@@ -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;
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116972): https://edk2.groups.io/g/devel/message/116972
Mute This Topic: https://groups.io/mt/105067984/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to