diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-25 02:27:50 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-25 02:27:50 +0000 |
commit | 8062bfcd7f339dd286e4308bb78e56ae1c4a3045 (patch) | |
tree | c1700500c61dac5a8fa4ae2c70ed622afd6a4cfe /MdePkg/Library/BaseLib/X86GetInterruptState.c | |
parent | 5e7828f0f63c4fb3f887f9db9f94a8201d7bca96 (diff) | |
download | edk2-platforms-8062bfcd7f339dd286e4308bb78e56ae1c4a3045.tar.xz |
Change name.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5972 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseLib/X86GetInterruptState.c')
-rw-r--r-- | MdePkg/Library/BaseLib/X86GetInterruptState.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseLib/X86GetInterruptState.c b/MdePkg/Library/BaseLib/X86GetInterruptState.c new file mode 100644 index 0000000000..0b63addf14 --- /dev/null +++ b/MdePkg/Library/BaseLib/X86GetInterruptState.c @@ -0,0 +1,41 @@ +/** @file
+ IA-32/x64 GetInterruptState()
+
+ Copyright (c) 2006, Intel Corporation<BR>
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+#include <BaseLibInternals.h>
+
+
+/**
+ Retrieves the current CPU interrupt state.
+
+ 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);
+}
+
+
|