VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/UnitTestHost.c

Last change on this file was 99404, checked in by vboxsync, 2 years ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/** @file
2 Common Unit Test Host functions.
3
4 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include "UnitTestHost.h"
10
11///
12/// Module global variable for simple system emulation of interrupt state
13///
14STATIC BOOLEAN mUnitTestHostBaseLibInterruptState;
15
16/**
17 Enables CPU interrupts.
18
19**/
20VOID
21EFIAPI
22UnitTestHostBaseLibEnableInterrupts (
23 VOID
24 )
25{
26 mUnitTestHostBaseLibInterruptState = TRUE;
27}
28
29/**
30 Disables CPU interrupts.
31
32**/
33VOID
34EFIAPI
35UnitTestHostBaseLibDisableInterrupts (
36 VOID
37 )
38{
39 mUnitTestHostBaseLibInterruptState = FALSE;
40}
41
42/**
43 Enables CPU interrupts for the smallest window required to capture any
44 pending interrupts.
45
46**/
47VOID
48EFIAPI
49UnitTestHostBaseLibEnableDisableInterrupts (
50 VOID
51 )
52{
53 mUnitTestHostBaseLibInterruptState = FALSE;
54}
55
56/**
57 Set the current CPU interrupt state.
58
59 Sets the current CPU interrupt state to the state specified by
60 InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
61 InterruptState is FALSE, then interrupts are disabled. InterruptState is
62 returned.
63
64 @param InterruptState TRUE if interrupts should enabled. FALSE if
65 interrupts should be disabled.
66
67 @return InterruptState
68
69**/
70BOOLEAN
71EFIAPI
72UnitTestHostBaseLibGetInterruptState (
73 VOID
74 )
75{
76 return mUnitTestHostBaseLibInterruptState;
77}
78
79/**
80 Enables CPU interrupts.
81
82**/
83VOID
84EFIAPI
85EnableInterrupts (
86 VOID
87 )
88{
89 gUnitTestHostBaseLib.Common->EnableInterrupts ();
90}
91
92/**
93 Disables CPU interrupts.
94
95**/
96VOID
97EFIAPI
98DisableInterrupts (
99 VOID
100 )
101{
102 gUnitTestHostBaseLib.Common->DisableInterrupts ();
103}
104
105/**
106 Enables CPU interrupts for the smallest window required to capture any
107 pending interrupts.
108
109**/
110VOID
111EFIAPI
112EnableDisableInterrupts (
113 VOID
114 )
115{
116 gUnitTestHostBaseLib.Common->EnableDisableInterrupts ();
117}
118
119/**
120 Set the current CPU interrupt state.
121
122 Sets the current CPU interrupt state to the state specified by
123 InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
124 InterruptState is FALSE, then interrupts are disabled. InterruptState is
125 returned.
126
127 @param InterruptState TRUE if interrupts should enabled. FALSE if
128 interrupts should be disabled.
129
130 @return InterruptState
131
132**/
133BOOLEAN
134EFIAPI
135GetInterruptState (
136 VOID
137 )
138{
139 return gUnitTestHostBaseLib.Common->GetInterruptState ();
140}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette