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