UINTN Index;\r
BM_MENU_ENTRY *NewMenuEntry;\r
BM_FILE_CONTEXT *NewFileContext;\r
+ BOOLEAN BootMaintMenuResetRequired;\r
\r
Location = NULL;\r
Index = 0;\r
while (1) {\r
UpdatePageId (CallbackData, FORM_MAIN_ID);\r
\r
+ BootMaintMenuResetRequired = FALSE;\r
Status = FormConfig->SendForm (\r
FormConfig,\r
TRUE,\r
NULL,\r
(UINT8 *) CallbackData->BmmFakeNvData,\r
NULL,\r
- NULL\r
+ &BootMaintMenuResetRequired\r
);\r
\r
+ if (BootMaintMenuResetRequired) {\r
+ EnableResetRequired ();\r
+ }\r
+\r
ReclaimStringDepository ();\r
\r
//\r
if (INACTIVE_STATE != CallbackData->FeCurrentState) {\r
UpdateFileExplorer (CallbackData, 0);\r
\r
+ BootMaintMenuResetRequired = FALSE;\r
Status = FormConfig->SendForm (\r
FormConfig,\r
TRUE,\r
NULL,\r
NULL,\r
NULL,\r
- NULL\r
+ &BootMaintMenuResetRequired\r
);\r
\r
+ if (BootMaintMenuResetRequired) {\r
+ EnableResetRequired ();\r
+ }\r
+\r
CallbackData->FeCurrentState = INACTIVE_STATE;\r
CallbackData->FeDisplayContext = UNKNOWN_CONTEXT;\r
ReclaimStringDepository ();\r
UINT8 *Location;\r
EFI_GUID BmGuid;\r
LIST_ENTRY BdsBootOptionList;\r
+ BOOLEAN BootMngrMenuResetRequired;\r
\r
gOption = NULL;\r
InitializeListHead (&BdsBootOptionList);\r
\r
ASSERT (gBrowser);\r
\r
- gBrowser->SendForm (gBrowser, TRUE, &gBootManagerHandle, 1, NULL, NULL, NULL, NULL, NULL);\r
+ BootMngrMenuResetRequired = FALSE;\r
+ gBrowser->SendForm (\r
+ gBrowser, \r
+ TRUE, \r
+ &gBootManagerHandle, \r
+ 1, \r
+ NULL, \r
+ NULL, \r
+ NULL, \r
+ NULL, \r
+ &BootMngrMenuResetRequired\r
+ );\r
+\r
+ if (BootMngrMenuResetRequired) {\r
+ EnableResetRequired ();\r
+ }\r
\r
Hii->ResetStrings (Hii, gBootManagerHandle);\r
\r
if (gOption == NULL) {\r
return ;\r
}\r
+ \r
+ //\r
+ //Will leave browser, check any reset required change is applied? if yes, reset system\r
+ //\r
+ SetupResetReminder ();\r
+ \r
//\r
// BugBug: This code looks repeated from the BDS. Need to save code space.\r
//\r
UINTN VideoOptionSize;\r
EFI_HII_HANDLE *HiiHandles;\r
UINT16 HandleBufferLength;\r
+ BOOLEAN BootDeviceMngrMenuResetRequired;\r
\r
IfrOptionList = NULL;\r
VideoOption = NULL;\r
gBS->FreePool (IfrOptionList);\r
}\r
\r
+ BootDeviceMngrMenuResetRequired = FALSE;\r
Status = gBrowser->SendForm (\r
gBrowser,\r
TRUE, // Use the database\r
FPCallbackInfo.CallbackHandle,\r
(UINT8 *) &FPCallbackInfo.Data,\r
NULL,\r
- NULL\r
+ &BootDeviceMngrMenuResetRequired\r
);\r
\r
+ if (BootDeviceMngrMenuResetRequired) {\r
+ EnableResetRequired ();\r
+ }\r
+\r
Hii->ResetStrings (Hii, FPCallbackInfo.DevMgrHiiHandle);\r
\r
//\r
// a target to display\r
//\r
if (gCallbackKey != 0 && gCallbackKey < 0x2000) {\r
+ BootDeviceMngrMenuResetRequired = FALSE;\r
Status = gBrowser->SendForm (\r
gBrowser,\r
TRUE, // Use the database\r
NULL, // This is the handle that the interface to the callback was installed on\r
NULL,\r
NULL,\r
- NULL\r
+ &BootDeviceMngrMenuResetRequired\r
);\r
\r
+ if (BootDeviceMngrMenuResetRequired) {\r
+ EnableResetRequired ();\r
+ }\r
//\r
// Force return to Device Manager\r
//\r
{\r
EFI_STATUS Status;\r
UINT8 FakeNvRamMap[1];\r
+ BOOLEAN FrontPageMenuResetRequired;\r
\r
//\r
// Begin waiting for USER INPUT\r
);\r
\r
FakeNvRamMap[0] = (UINT8) mLastSelection;\r
+ FrontPageMenuResetRequired = FALSE;\r
Status = gBrowser->SendForm (\r
gBrowser,\r
TRUE, // Use the database\r
FrontPageCallbackHandle, // This is the handle that the interface to the callback was installed on\r
FakeNvRamMap,\r
NULL,\r
- NULL\r
+ &FrontPageMenuResetRequired\r
);\r
+ //\r
+ // Check whether user change any option setting which needs a reset to be effective\r
+ // \r
+ if (FrontPageMenuResetRequired) {\r
+ EnableResetRequired ();\r
+ }\r
\r
Hii->ResetStrings (Hii, gFrontPageHandle);\r
\r
\r
} while ((Status == EFI_SUCCESS) && (gCallbackKey != 1));\r
\r
+ //\r
+ //Will leave browser, check any reset required change is applied? if yes, reset system\r
+ //\r
+ SetupResetReminder ();\r
+ \r
//\r
// Automatically load current entry\r
// Note: The following lines of code only execute when Auto boot\r
#define MIN_ALIGNMENT_SIZE 4\r
#define ALIGN_SIZE(a) ((a % MIN_ALIGNMENT_SIZE) ? MIN_ALIGNMENT_SIZE - (a % MIN_ALIGNMENT_SIZE) : 0)\r
\r
+//\r
+// Define maximum characters for boot option variable "BootXXXX"\r
+//\r
+#define BOOT_OPTION_MAX_CHAR 10\r
+\r
//\r
// This data structure is the part of BDS_CONNECT_ENTRY that we can hard code.\r
//\r
IN BDS_COMMON_OPTION *Entry\r
);\r
\r
+EFI_STATUS\r
+BdsDeleteBootOption (\r
+ IN UINTN OptionNumber,\r
+ IN OUT UINT16 *BootOrder,\r
+ IN OUT UINTN *BootOrderSize\r
+ );\r
+\r
+//\r
+//The interface functions relate with Setup Browser Reset Reminder feature\r
+//\r
+VOID\r
+EnableResetReminderFeature (\r
+ VOID\r
+ );\r
+\r
+VOID\r
+DisableResetReminderFeature (\r
+ VOID\r
+ );\r
+\r
+VOID\r
+EnableResetRequired (\r
+ VOID\r
+ );\r
+\r
+VOID\r
+DisableResetRequired (\r
+ VOID\r
+ );\r
+\r
+BOOLEAN\r
+IsResetReminderFeatureEnable (\r
+ VOID\r
+ );\r
+\r
+BOOLEAN\r
+IsResetRequired (\r
+ VOID\r
+ );\r
+\r
+VOID\r
+SetupResetReminder (\r
+ VOID\r
+ );\r
+ \r
#endif // _BDS_LIB_H_\r
\r
--*/\r
\r
+#define MAX_STRING_LEN 200\r
+static BOOLEAN mFeaturerSwitch = TRUE;\r
+static BOOLEAN mResetRequired = FALSE;\r
extern UINT16 gPlatformBootTimeOutDefault;\r
\r
UINT16\r
\r
return Status;\r
}\r
+\r
+//\r
+// Following are BDS Lib functions which contain all the code about setup browser reset reminder feature.\r
+// Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser if \r
+// user change any option setting which needs a reset to be effective, and the reset will be applied according to the user selection.\r
+//\r
+\r
+VOID\r
+EnableResetReminderFeature (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Enable the setup browser reset reminder feature.\r
+ This routine is used in platform tip. If the platform policy need the feature, use the routine to enable it.\r
+\r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ mFeaturerSwitch = TRUE;\r
+} \r
+\r
+VOID\r
+DisableResetReminderFeature (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Disable the setup browser reset reminder feature.\r
+ This routine is used in platform tip. If the platform policy do not want the feature, use the routine to disable it.\r
+ \r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ mFeaturerSwitch = FALSE;\r
+} \r
+\r
+VOID\r
+EnableResetRequired (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Record the info that a reset is required.\r
+ A module boolean variable is used to record whether a reset is required. \r
+ \r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ mResetRequired = TRUE;\r
+} \r
+\r
+VOID\r
+DisableResetRequired (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Record the info that no reset is required.\r
+ A module boolean variable is used to record whether a reset is required. \r
+\r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ mResetRequired = FALSE;\r
+} \r
+\r
+BOOLEAN\r
+IsResetReminderFeatureEnable (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Check whether platform policy enable the reset reminder feature. The default is enabled.\r
+\r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ return mFeaturerSwitch;\r
+}\r
+\r
+BOOLEAN\r
+IsResetRequired (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Check if user changed any option setting which needs a system reset to be effective.\r
+ \r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ return mResetRequired;\r
+}\r
+\r
+VOID\r
+SetupResetReminder (\r
+ VOID\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+ \r
+ Check whether a reset is needed, and finish the reset reminder feature.\r
+ If a reset is needed, Popup a menu to notice user, and finish the feature \r
+ according to the user selection.\r
+\r
+Arguments:\r
+\r
+ VOID\r
+\r
+Returns:\r
+\r
+ VOID\r
+\r
+--*/\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_FORM_BROWSER_PROTOCOL *Browser;\r
+ EFI_INPUT_KEY Key; \r
+ CHAR16 *StringBuffer1;\r
+ CHAR16 *StringBuffer2; \r
+\r
+\r
+ //\r
+ //check any reset required change is applied? if yes, reset system\r
+ //\r
+ if (IsResetReminderFeatureEnable ()) {\r
+ if (IsResetRequired ()) {\r
+ \r
+ Status = gBS->LocateProtocol (\r
+ &gEfiFormBrowserProtocolGuid,\r
+ NULL,\r
+ &Browser\r
+ ); \r
+ \r
+ StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));\r
+ ASSERT (StringBuffer1 != NULL);\r
+ StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));\r
+ ASSERT (StringBuffer2 != NULL); \r
+ StrCpy (StringBuffer1, L"Configuration changed. Reset to apply it Now ? ");\r
+ StrCpy (StringBuffer2, L"Enter (YES) / Esc (NO)"); \r
+ //\r
+ // Popup a menu to notice user\r
+ // \r
+ do {\r
+ Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2);\r
+ } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN)); \r
+ \r
+ gBS->FreePool (StringBuffer1); \r
+ gBS->FreePool (StringBuffer2); \r
+ //\r
+ // If the user hits the YES Response key, reset\r
+ //\r
+ if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN)) {\r
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);\r
+ }\r
+ gST->ConOut->ClearScreen (gST->ConOut);\r
+ } \r
+ } \r
+} \r