// 6. Adjust the different type memory page number just before booting\r
// and save the updated info into the variable for next boot to use\r
//\r
- if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT) {\r
- if (PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {\r
- BmSetMemoryTypeInformationVariable ();\r
- }\r
- }\r
+ BmSetMemoryTypeInformationVariable (\r
+ (BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT)\r
+ );\r
\r
DEBUG_CODE_BEGIN();\r
if (BootOption->Description == NULL) {\r
\r
/**\r
This routine adjust the memory information for different memory type and \r
- save them into the variables for next boot.\r
+ save them into the variables for next boot. It resets the system when\r
+ memory information is updated and the current boot option belongs to\r
+ boot category instead of application category.\r
+\r
+ @param Boot TRUE if current boot option belongs to boot category instead of\r
+ application category.\r
**/\r
VOID\r
BmSetMemoryTypeInformationVariable (\r
- VOID\r
+ IN BOOLEAN Boot\r
)\r
{\r
EFI_STATUS Status;\r
\r
if (!EFI_ERROR (Status)) {\r
//\r
- // If the Memory Type Information settings have been modified, then reset the platform\r
- // so the new Memory Type Information setting will be used to guarantee that an S4\r
+ // If the Memory Type Information settings have been modified and the boot option belongs to boot category,\r
+ // then reset the platform so the new Memory Type Information setting will be used to guarantee that an S4\r
// entry/resume cycle will not fail.\r
//\r
- if (MemoryTypeInformationModified) {\r
+ if (MemoryTypeInformationModified && Boot && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {\r
DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));\r
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r
}\r
\r
/**\r
This routine adjust the memory information for different memory type and \r
- save them into the variables for next boot.\r
+ save them into the variables for next boot. It resets the system when\r
+ memory information is updated and the current boot option belongs to\r
+ boot category instead of application category.\r
+\r
+ @param Boot TRUE if current boot option belongs to boot category instead of\r
+ application category.\r
**/\r
VOID\r
BmSetMemoryTypeInformationVariable (\r
- VOID\r
+ IN BOOLEAN Boot\r
);\r
\r
/**\r