]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | Base Library CPU Functions for all architectures.\r | |
3 | \r | |
127010dd | 4 | Copyright (c) 2006 - 2010, 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 | |
47fc17d8 | 9 | #include "BaseLibInternals.h"\r |
f734a10a | 10 | \r |
e1f414b6 | 11 | \r |
12 | /**\r | |
13 | Disables CPU interrupts and returns the interrupt state prior to the disable\r | |
14 | operation.\r | |
15 | \r | |
e1f414b6 | 16 | @retval TRUE CPU interrupts were enabled on entry to this call.\r |
17 | @retval FALSE CPU interrupts were disabled on entry to this call.\r | |
18 | \r | |
19 | **/\r | |
20 | BOOLEAN\r | |
21 | EFIAPI\r | |
22 | SaveAndDisableInterrupts (\r | |
23 | VOID\r | |
24 | )\r | |
25 | {\r | |
26 | BOOLEAN InterruptState;\r | |
27 | \r | |
28 | InterruptState = GetInterruptState ();\r | |
29 | DisableInterrupts ();\r | |
30 | return InterruptState;\r | |
31 | }\r | |
32 | \r | |
33 | /**\r | |
34 | Set the current CPU interrupt state.\r | |
35 | \r | |
36 | Sets the current CPU interrupt state to the state specified by\r | |
37 | InterruptState. If InterruptState is TRUE, then interrupts are enabled. If\r | |
38 | InterruptState is FALSE, then interrupts are disabled. InterruptState is\r | |
39 | returned.\r | |
40 | \r | |
127010dd | 41 | @param InterruptState TRUE if interrupts should be enabled. FALSE if\r |
e1f414b6 | 42 | interrupts should be disabled.\r |
43 | \r | |
9aa049d9 | 44 | @return InterruptState\r |
e1f414b6 | 45 | \r |
46 | **/\r | |
47 | BOOLEAN\r | |
48 | EFIAPI\r | |
49 | SetInterruptState (\r | |
50 | IN BOOLEAN InterruptState\r | |
51 | )\r | |
52 | {\r | |
53 | if (InterruptState) {\r | |
54 | EnableInterrupts ();\r | |
55 | } else {\r | |
56 | DisableInterrupts ();\r | |
57 | }\r | |
58 | return InterruptState;\r | |
59 | }\r |