]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/X86GetInterruptState.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / X86GetInterruptState.c
CommitLineData
e1f414b6 1/** @file\r
2 IA-32/x64 GetInterruptState()\r
3\r
bb817c56 4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e1f414b6 6\r
e1f414b6 7**/\r
8\r
1efcc4ae 9\r
47fc17d8 10#include "BaseLibInternals.h"\r
f734a10a 11\r
e1f414b6 12\r
13/**\r
14 Retrieves the current CPU interrupt state.\r
15\r
9aa049d9 16 Returns TRUE is interrupts are currently enabled. Otherwise\r
17 returns FALSE.\r
e1f414b6 18\r
19 @retval TRUE CPU interrupts are enabled.\r
20 @retval FALSE CPU interrupts are disabled.\r
21\r
22**/\r
23BOOLEAN\r
24EFIAPI\r
25GetInterruptState (\r
26 VOID\r
27 )\r
28{\r
29 IA32_EFLAGS32 EFlags;\r
30\r
31 EFlags.UintN = AsmReadEflags ();\r
38bbd3d9 32 return (BOOLEAN)(1 == EFlags.Bits.IF);\r
e1f414b6 33}\r
34\r
35\r