CrScreenshotDxe: Work around TPL-related ASSERT within firmware compiled to assert (#539)

(such as recently updated DEBUG version of OpenDuet)
This commit is contained in:
Mike Beaton 2024-04-29 08:47:09 +01:00 committed by GitHub
parent ac0110a103
commit 737dd930e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -166,6 +166,16 @@ TakeScreenshot (
UINTN Index;
UINT8 Temp;
//
// This is required to avoid assert (only noticeable on firmware compiled to
// assert) from gBS->RaiseTPL(TPL_CALLBACK) within the file system accesses
// below. Makes explicit what was happening anyway, which is that we're
// effectively lowering the TPL for a long running task, during a keyboard
// interrupt.
// REF: https://github.com/acidanthera/audk/blob/bcdcc4160d7460c46c08c9395aae81be44ef23a9/FatPkg/EnhancedFatDxe/Misc.c#L399
//
gBS->RestoreTPL (TPL_CALLBACK);
Status = OcFindWritableOcFileSystem (&Fs);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSCR: Can't find writable FS - %r\n", Status));