From 8062bfcd7f339dd286e4308bb78e56ae1c4a3045 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Thu, 25 Sep 2008 02:27:50 +0000 Subject: Change name. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5972 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseLib/X86GetInterruptState.c | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 MdePkg/Library/BaseLib/X86GetInterruptState.c (limited to 'MdePkg/Library/BaseLib/X86GetInterruptState.c') 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
+ 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 + + +/** + 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); +} + + -- cgit v1.2.3