aboutsummaryrefslogtreecommitdiffstats
path: root/roms/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c
diff options
context:
space:
mode:
Diffstat (limited to 'roms/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c')
-rw-r--r--roms/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/roms/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c b/roms/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c
new file mode 100644
index 000000000..4363a7fda
--- /dev/null
+++ b/roms/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c
@@ -0,0 +1,35 @@
+/** @file
+ IA-32/x64 GetInterruptState()
+
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+
+#include "BaseLibInternals.h"
+
+
+/**
+ Retrieves the current CPU interrupt state.
+
+ Returns TRUE is interrupts are currently enabled. Otherwise
+ returns FALSE.
+
+ @retval TRUE CPU interrupts are enabled.
+ @retval FALSE CPU interrupts are disabled.
+
+**/
+BOOLEAN
+EFIAPI
+GetInterruptState (
+ VOID
+ )
+{
+ IA32_EFLAGS32 EFlags;
+
+ EFlags.UintN = AsmReadEflags ();
+ return (BOOLEAN)(1 == EFlags.Bits.IF);
+}
+
+