diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-07-07 10:58:14 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-07-07 12:49:01 +0800 |
commit | 1c03582b070a8feb0b43539cd918a37e3bd5b8da (patch) | |
tree | 1ac66a193b90915575a84725262ccc1b8ddde9b4 /IntelFrameworkModulePkg | |
parent | 984cb6462ac36bb90ce165e6507c31cda2369163 (diff) | |
download | edk2-platforms-1c03582b070a8feb0b43539cd918a37e3bd5b8da.tar.xz |
IntelFrameworkModulePkg/LegacyUi: Get legacy options when open legacy form
The LegacyBootMaintUiLib depends on the LegacyBootManagerLib to realize its
functionality, the LegacyBootManagerLib may initialize after
LegacyBootMaintUiLib, so the functionality of LegacyBootMaintUiLib may
be incorrect. Now we fix this issue by executing the related codes when
opening the legacy forminstead in its the constructor function. Because
when opening the legacy form, the LegacyBootManagerLib must have been
initialized.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c b/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c index 3a3eeed3e8..740c95ca96 100644 --- a/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c +++ b/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c @@ -19,6 +19,7 @@ LEGACY_BOOT_OPTION_CALLBACK_DATA *mLegacyBootOptionPrivate; EFI_GUID mLegacyBootOptionGuid = LEGACY_BOOT_OPTION_FORMSET_GUID;
CHAR16 mLegacyBootStorageName[] = L"LegacyBootData";
BBS_TYPE mBbsType[] = {BBS_FLOPPY, BBS_HARDDISK, BBS_CDROM, BBS_EMBED_NETWORK, BBS_BEV_DEVICE, BBS_UNKNOWN};
+BOOLEAN mFirstEnterLegacyForm = FALSE;
///
@@ -95,6 +96,26 @@ HII_VENDOR_DEVICE_PATH mLegacyBootOptionHiiVendorDevicePath = { }
};
+/**
+
+ Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().
+
+**/
+VOID
+GetLegacyOptions (
+ VOID
+ );
+
+
+/**
+
+ Base on the L"LegacyDevOrder" variable to build the current order data.
+
+**/
+VOID
+GetLegacyOptionsOrder (
+ VOID
+ );
/**
Re-order the Boot Option according to the DevOrder.
@@ -1094,9 +1115,9 @@ LegacyBootOptionCallback ( OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
)
{
- if (Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_CHANGING) {
+ if (Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_FORM_OPEN) {
//
- // Do nothing for other UEFI Action. Only do call back when data is changed.
+ // Do nothing for other UEFI Action. Only do call back when data is changed or the form is open.
//
return EFI_UNSUPPORTED;
}
@@ -1105,6 +1126,21 @@ LegacyBootOptionCallback ( return EFI_INVALID_PARAMETER;
}
+ if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+ if (QuestionId == FORM_FLOPPY_BOOT_ID) {
+ if (!mFirstEnterLegacyForm) {
+ //
+ // The leagcyBootMaintUiLib depends on the LegacyBootManagerLib to realize its functionality.
+ // We need to do the leagcy boot options related actions after the LegacyBootManagerLib has been initialized.
+ // Opening the legacy menus is the appropriate time that the LegacyBootManagerLib has already been initialized.
+ //
+ mFirstEnterLegacyForm = TRUE;
+ GetLegacyOptions ();
+ GetLegacyOptionsOrder ();
+ }
+ }
+ }
+
if (Action == EFI_BROWSER_ACTION_CHANGING) {
switch (QuestionId) {
case FORM_FLOPPY_BOOT_ID:
@@ -1426,10 +1462,6 @@ LegacyBootMaintUiLibConstructor ( ASSERT (LegacyBootOptionData->HiiHandle != NULL);
mLegacyBootOptionPrivate = LegacyBootOptionData;
-
- GetLegacyOptions ();
-
- GetLegacyOptionsOrder();
}
return EFI_SUCCESS;
|