diff options
Diffstat (limited to 'DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c')
-rw-r--r-- | DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c b/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c index c1fab403a7..6dc453ff09 100644 --- a/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c +++ b/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c @@ -140,10 +140,10 @@ LegacyBiosInt86 ( )
{
UINTN Status;
- UINTN Eflags;
IA32_REGISTER_SET ThunkRegSet;
BOOLEAN Ret;
UINT16 *Stack16;
+ BOOLEAN Enabled;
ZeroMem (&ThunkRegSet, sizeof (ThunkRegSet));
ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1;
@@ -169,10 +169,7 @@ LegacyBiosInt86 ( //
// The call to Legacy16 is a critical section to EFI
//
- Eflags = AsmReadEflags ();
- if ((Eflags | EFI_CPU_EFLAGS_IF) != 0) {
- DisableInterrupts ();
- }
+ Enabled = SaveAndDisableInterrupts();
//
// Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases.
@@ -199,9 +196,7 @@ LegacyBiosInt86 ( //
// End critical section
//
- if ((Eflags | EFI_CPU_EFLAGS_IF) != 0) {
- EnableInterrupts ();
- }
+ SetInterruptState (Enabled);
Regs->E.EDI = ThunkRegSet.E.EDI;
Regs->E.ESI = ThunkRegSet.E.ESI;
|