EFI_STRING gRTConfigRespBuffer = NULL;\r
UINTN gDatabaseInfoSize = 0;\r
UINTN gConfigRespSize = 0;\r
+BOOLEAN gExportConfigResp = TRUE;\r
\r
/**\r
This function generates a HII_DATABASE_RECORD node and adds into hii database.\r
@param NotifyType The type of change concerning the database.\r
@param PackageList Pointer to a package list which will be inserted\r
to.\r
- @param Package Created GUID pacakge\r
+ @param Package Created GUID package\r
\r
@retval EFI_SUCCESS Guid Package is inserted successfully.\r
@retval EFI_OUT_OF_RESOURCES Unable to allocate necessary resources for the new\r
PackageList->PackageListHdr.PackageLength -= Package->FormPkgHdr.Length;\r
FreePool (Package->IfrData);\r
FreePool (Package);\r
-\r
+ //\r
+ // If Hii runtime support feature is enabled,\r
+ // will export Hii info for runtime use after ReadyToBoot event triggered.\r
+ // If some driver add/update/remove packages from HiiDatabase after ReadyToBoot,\r
+ // will need to export the content of HiiDatabase.\r
+ // But if form packages removed, also need to export the ConfigResp string\r
+ //\r
+ if (gExportAfterReadyToBoot) {\r
+ gExportConfigResp = TRUE;\r
+ }\r
}\r
\r
return EFI_SUCCESS;\r
@param PackageList Pointer to a package list which will be adjusted.\r
\r
@retval EFI_SUCCESS Adjust all string packages successfully.\r
- @retval others Can't adjust string packges.\r
+ @retval others Can't adjust string packages.\r
\r
**/\r
EFI_STATUS\r
if (ImageInfoOffset != 0) {\r
ImageSize = ImagePackage->ImagePkgHdr.Header.Length -\r
sizeof (EFI_HII_IMAGE_PACKAGE_HDR) - PaletteSize;\r
- ImagePackage->ImageBlock = (UINT8 *) AllocateZeroPool (ImageSize);\r
+ ImagePackage->ImageBlock = AllocateZeroPool (ImageSize);\r
if (ImagePackage->ImageBlock == NULL) {\r
FreePool (ImagePackage->PaletteBlock);\r
FreePool (ImagePackage);\r
(UINT8) (PackageHeader.Type),\r
DatabaseRecord->Handle\r
);\r
+ //\r
+ // If Hii runtime support feature is enabled,\r
+ // will export Hii info for runtime use after ReadyToBoot event triggered.\r
+ // If some driver add/update/remove packages from HiiDatabase after ReadyToBoot,\r
+ // will need to export the content of HiiDatabase.\r
+ // But if form packages added/updated, also need to export the ConfigResp string.\r
+ //\r
+ if (gExportAfterReadyToBoot) {\r
+ gExportConfigResp = TRUE;\r
+ }\r
break;\r
case EFI_HII_PACKAGE_KEYBOARD_LAYOUT:\r
Status = InsertKeyboardLayoutPackage (\r
}\r
\r
/**\r
-This is an internal function,mainly use to get and update configuration settings information.\r
+This function mainly use to get and update ConfigResp string.\r
\r
@param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
\r
\r
**/\r
EFI_STATUS\r
-HiiGetConfigurationSetting(\r
+HiiGetConfigRespInfo(\r
IN CONST EFI_HII_DATABASE_PROTOCOL *This\r
)\r
{\r
\r
Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);\r
\r
- //\r
- // Get the HiiDatabase info.\r
- //\r
- HiiGetDatabaseInfo(This);\r
-\r
//\r
// Get ConfigResp string\r
//\r
\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
\r
\r
/**\r
- This function removes the package list that is associated with a handle Handle\r
+ This function removes the package list that is associated with Handle\r
from the HII database. Before removing the package, any registered functions\r
with the notification type REMOVE_PACK and the same package type will be called.\r
\r
\r
@retval EFI_SUCCESS The data associated with the Handle was removed\r
from the HII database.\r
- @retval EFI_NOT_FOUND The specified andle is not in database.\r
+ @retval EFI_NOT_FOUND The specified handle is not in database.\r
@retval EFI_INVALID_PARAMETER The Handle was not valid.\r
\r
**/\r
buffer that is required for the handles found.\r
@param Handle An array of EFI_HII_HANDLE instances returned.\r
\r
- @retval EFI_SUCCESS The matching handles are outputed successfully.\r
+ @retval EFI_SUCCESS The matching handles are outputted successfully.\r
HandleBufferLength is updated with the actual length.\r
@retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
Handle is too small to support the number of\r
}\r
break;\r
//\r
- // Pesudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package handles\r
+ // Pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package handles\r
// to be listed.\r
//\r
case EFI_HII_PACKAGE_TYPE_ALL:\r
Handle is too small to support the number of\r
handles. HandleBufferLength is updated with a\r
value that will enable the data to fit.\r
- @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the\r
+ @retval EFI_NOT_FOUND The specified Handle could not be found in the\r
current database.\r
@retval EFI_INVALID_PARAMETER BufferSize was NULL.\r
@retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero \r