Do not reset system when the MemoryTypeInformation variable cannot be written.
Remove the RT attribute for the MemoryTypeInformation variable because it’s not necessary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15333 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Misc BDS library function
|
Misc BDS library function
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -1422,19 +1422,23 @@ BdsSetMemoryTypeInformationVariable (
|
|||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
|
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
|
||||||
&gEfiMemoryTypeInformationGuid,
|
&gEfiMemoryTypeInformationGuid,
|
||||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||||
VariableSize,
|
VariableSize,
|
||||||
PreviousMemoryTypeInformation
|
PreviousMemoryTypeInformation
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
if (!EFI_ERROR (Status)) {
|
||||||
// If the Memory Type Information settings have been modified, then reset the platform
|
//
|
||||||
// so the new Memory Type Information setting will be used to guarantee that an S4
|
// If the Memory Type Information settings have been modified, then reset the platform
|
||||||
// entry/resume cycle will not fail.
|
// so the new Memory Type Information setting will be used to guarantee that an S4
|
||||||
//
|
// entry/resume cycle will not fail.
|
||||||
if (MemoryTypeInformationModified && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {
|
//
|
||||||
DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));
|
if (MemoryTypeInformationModified && PcdGetBool (PcdResetOnMemoryTypeInformationChange)) {
|
||||||
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
|
DEBUG ((EFI_D_INFO, "Memory Type Information settings change. Warm Reset!!!\n"));
|
||||||
|
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DEBUG ((EFI_D_ERROR, "Memory Type Information settings cannot be saved. OS S4 may fail!\n"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user