]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c
ArmPkg/ArmSvcLib: Add ArmSvcLib implementation.
[mirror_edk2.git] / DuetPkg / BiosVideoThunkDxe / LegacyBiosThunk.c
index 0f02659b6b84eaecb5bbeae8dc0616a67d374885..6dc453ff0932e10dce8115a1032c9b5db7ad9731 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Provide legacy thunk interface for accessing Bios Video Rom.\r
   \r
-Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -140,10 +140,10 @@ LegacyBiosInt86 (
   )\r
 {\r
   UINTN                 Status;\r
-  UINTN                 Eflags;\r
   IA32_REGISTER_SET     ThunkRegSet;\r
   BOOLEAN               Ret;\r
   UINT16                *Stack16;\r
+  BOOLEAN               Enabled;\r
   \r
   ZeroMem (&ThunkRegSet, sizeof (ThunkRegSet));\r
   ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1;\r
@@ -169,10 +169,7 @@ LegacyBiosInt86 (
   //\r
   // The call to Legacy16 is a critical section to EFI\r
   //\r
-  Eflags = AsmReadEflags ();\r
-  if ((Eflags | EFI_CPU_EFLAGS_IF) != 0) {\r
-    DisableInterrupts ();\r
-  }\r
+  Enabled = SaveAndDisableInterrupts();\r
 \r
   //\r
   // Set Legacy16 state. 0x08, 0x70 is legacy 8259 vector bases.\r
@@ -199,9 +196,7 @@ LegacyBiosInt86 (
   //\r
   // End critical section\r
   //\r
-  if ((Eflags | EFI_CPU_EFLAGS_IF) != 0) {\r
-    EnableInterrupts ();\r
-  }\r
+  SetInterruptState (Enabled);\r
 \r
   Regs->E.EDI      = ThunkRegSet.E.EDI;      \r
   Regs->E.ESI      = ThunkRegSet.E.ESI;  \r