Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added logic to delete the Memory Type Information variable on a capsule update. #271

21 changes: 21 additions & 0 deletions MsCorePkg/Library/PlatformBootManagerLib/BdsPlatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ PlatformBootManagerAfterConsole (
)
{
EFI_STATUS Status;
UINT32 Attributes;
UINTN VariableSize = 0;

// EFI_INPUT_KEY Key;

Expand Down Expand Up @@ -388,6 +390,25 @@ PlatformBootManagerAfterConsole (
case BOOT_ON_FLASH_UPDATE:
EfiBootManagerConnectAll ();
DEBUG ((DEBUG_INFO, "[%a] - signalling capsules are ready for processing\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "[%a] - Deleting Memory Type Information variable for capsule update\n", __FUNCTION__));
Status = gRT->GetVariable (
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
&gEfiMemoryTypeInformationGuid,
&Attributes,
&VariableSize,
NULL
);
if (Status == EFI_BUFFER_TOO_SMALL) {
Status = gRT->SetVariable (
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
&gEfiMemoryTypeInformationGuid,
Attributes,
0,
NULL
);
ASSERT_EFI_ERROR (Status);
}

EfiEventGroupSignal (&gMuReadyToProcessCapsulesNotifyGuid);
Status = ProcessCapsules ();

Expand Down
1 change: 1 addition & 0 deletions MsCorePkg/Library/PlatformBootManagerLib/BdsPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include <Guid/CapsuleVendor.h>

#include <Guid/MemoryTypeInformation.h>
#include <Guid/EventGroup.h>
#include <Guid/GlobalVariable.h>
#include <Guid/MemoryOverwriteControl.h>
Expand Down