]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
MdeModulePkg/HiiDB: Reorganize codes of exporting HII settings
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Database.c
index 664687796f014b40583feef9898a1e56f37c8083..655eba8cb90402dd48c91ff8656c97e87f44b8ef 100644 (file)
@@ -21,7 +21,7 @@ EFI_HII_PACKAGE_LIST_HEADER    *gRTDatabaseInfoBuffer = NULL;
 EFI_STRING                     gRTConfigRespBuffer    = NULL;\r
 UINTN                          gDatabaseInfoSize = 0;\r
 UINTN                          gConfigRespSize = 0;\r
-BOOLEAN                        gExportConfigResp = TRUE;\r
+BOOLEAN                        gExportConfigResp = FALSE;\r
 UINTN                          gNvDefaultStoreSize = 0;\r
 SKU_ID                         gSkuId              = 0xFFFFFFFFFFFFFFFF;\r
 LIST_ENTRY                     gVarStorageList     = INITIALIZE_LIST_HEAD_VARIABLE (gVarStorageList);\r
@@ -3435,39 +3435,6 @@ HiiGetDatabaseInfo(
 \r
 }\r
 \r
-/**\r
-This  function mainly use to get and update configuration settings information.\r
-\r
-@param  This                   A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
-\r
-@retval EFI_SUCCESS            Get the information successfully.\r
-@retval EFI_OUT_OF_RESOURCES   Not enough memory to store the Configuration Setting data.\r
-\r
-**/\r
-EFI_STATUS\r
-HiiGetConfigurationSetting(\r
-  IN CONST EFI_HII_DATABASE_PROTOCOL        *This\r
-  )\r
-{\r
-  EFI_STATUS                          Status;\r
-\r
-  //\r
-  // Get the HiiDatabase info.\r
-  //\r
-  Status = HiiGetDatabaseInfo(This);\r
-\r
-  //\r
-  // Get ConfigResp string\r
-  //\r
-  if (gExportConfigResp) {\r
-    Status = HiiGetConfigRespInfo (This);\r
-    gExportConfigResp = FALSE;\r
-  }\r
-  return Status;\r
-\r
-}\r
-\r
-\r
 /**\r
   This function adds the packages in the package list to the database and returns a handle. If there is a\r
   EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will\r
@@ -3561,11 +3528,19 @@ HiiNewPackageList (
   *Handle = DatabaseRecord->Handle;\r
 \r
   //\r
-  // Check whether need to get the Database and configuration setting info.\r
+  // Check whether need to get the Database info.\r
   // Only after ReadyToBoot, need to do the export.\r
   //\r
   if (gExportAfterReadyToBoot) {\r
-    HiiGetConfigurationSetting(This);\r
+    HiiGetDatabaseInfo (This);\r
+  }\r
+\r
+  //\r
+  // Check whether need to get the configuration setting info from HII drivers.\r
+  // When after ReadyToBoot and need to do the export for form package add.\r
+  //\r
+  if (gExportAfterReadyToBoot && gExportConfigResp) {\r
+    HiiGetConfigRespInfo (This);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -3674,11 +3649,19 @@ HiiRemovePackageList (
       FreePool (Node);\r
 \r
       //\r
-      // Check whether need to get the Database and configuration setting info.\r
+      // Check whether need to get the Database info.\r
       // Only after ReadyToBoot, need to do the export.\r
       //\r
       if (gExportAfterReadyToBoot) {\r
-        HiiGetConfigurationSetting(This);\r
+        HiiGetDatabaseInfo (This);\r
+      }\r
+\r
+      //\r
+      // Check whether need to get the configuration setting info from HII drivers.\r
+      // When after ReadyToBoot and need to do the export for form package remove.\r
+      //\r
+      if (gExportAfterReadyToBoot && gExportConfigResp) {\r
+        HiiGetConfigRespInfo (This);\r
       }\r
       return EFI_SUCCESS;\r
     }\r
@@ -3790,13 +3773,19 @@ HiiUpdatePackageList (
       Status = AddPackages (Private, EFI_HII_DATABASE_NOTIFY_ADD_PACK, PackageList, Node);\r
 \r
       //\r
-      // Check whether need to get the Database and configuration setting info.\r
+      // Check whether need to get the Database info.\r
       // Only after ReadyToBoot, need to do the export.\r
       //\r
-      if (gExportAfterReadyToBoot) {\r
-        if (Status == EFI_SUCCESS){\r
-          HiiGetConfigurationSetting(This);\r
-        }\r
+      if (gExportAfterReadyToBoot && Status == EFI_SUCCESS) {\r
+        HiiGetDatabaseInfo (This);\r
+      }\r
+\r
+      //\r
+      // Check whether need to get the configuration setting info from HII drivers.\r
+      // When after ReadyToBoot and need to do the export for form package update.\r
+      //\r
+      if (gExportAfterReadyToBoot && gExportConfigResp && Status == EFI_SUCCESS) {\r
+        HiiGetConfigRespInfo (This);\r
       }\r
 \r
       return Status;\r