Skip to content

Commit 737dd93

Browse files
authored
CrScreenshotDxe: Work around TPL-related ASSERT within firmware compiled to assert (#539)
(such as recently updated DEBUG version of OpenDuet)
1 parent ac0110a commit 737dd93

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Platform/CrScreenshotDxe/CrScreenshotDxe.c

+10
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ TakeScreenshot (
166166
UINTN Index;
167167
UINT8 Temp;
168168

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

0 commit comments

Comments
 (0)