TianoCore EDK2
master
Loading...
Searching...
No Matches
Library.c
Go to the documentation of this file.
1
9
#include "
DxeMain.h
"
10
11
//
12
// Lock Stuff
13
//
14
28
EFI_STATUS
29
CoreAcquireLockOrFail
(
30
IN
EFI_LOCK
*
Lock
31
)
32
{
33
ASSERT (
Lock
!=
NULL
);
34
ASSERT (
Lock
->Lock != EfiLockUninitialized);
35
36
if
(
Lock
->Lock == EfiLockAcquired) {
37
//
38
// Lock is already owned, so bail out
39
//
40
return
EFI_ACCESS_DENIED;
41
}
42
43
Lock
->OwnerTpl =
CoreRaiseTpl
(
Lock
->Tpl);
44
45
Lock
->Lock = EfiLockAcquired;
46
return
EFI_SUCCESS
;
47
}
48
58
VOID
59
CoreAcquireLock
(
60
IN
EFI_LOCK
*
Lock
61
)
62
{
63
ASSERT (
Lock
!=
NULL
);
64
ASSERT (
Lock
->Lock == EfiLockReleased);
65
66
Lock
->OwnerTpl =
CoreRaiseTpl
(
Lock
->Tpl);
67
Lock
->Lock = EfiLockAcquired;
68
}
69
79
VOID
80
CoreReleaseLock
(
81
IN
EFI_LOCK
*
Lock
82
)
83
{
84
EFI_TPL
Tpl;
85
86
ASSERT (
Lock
!=
NULL
);
87
ASSERT (
Lock
->Lock == EfiLockAcquired);
88
89
Tpl =
Lock
->OwnerTpl;
90
91
Lock
->Lock = EfiLockReleased;
92
93
CoreRestoreTpl
(Tpl);
94
}
DxeMain.h
CoreRaiseTpl
EFI_TPL EFIAPI CoreRaiseTpl(IN EFI_TPL NewTpl)
Definition:
Tpl.c:57
CoreRestoreTpl
VOID EFIAPI CoreRestoreTpl(IN EFI_TPL NewTpl)
Definition:
Tpl.c:95
CoreAcquireLockOrFail
EFI_STATUS CoreAcquireLockOrFail(IN EFI_LOCK *Lock)
Definition:
Library.c:29
CoreAcquireLock
VOID CoreAcquireLock(IN EFI_LOCK *Lock)
Definition:
Library.c:59
CoreReleaseLock
VOID CoreReleaseLock(IN EFI_LOCK *Lock)
Definition:
Library.c:80
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
Lock
EFI_STATUS EFIAPI Lock(IN EFI_SMM_ACCESS2_PROTOCOL *This)
Definition:
SmmAccessDxe.c:133
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_TPL
UINTN EFI_TPL
Definition:
UefiBaseType.h:41
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
EFI_LOCK
Definition:
UefiLib.h:58
MdeModulePkg
Core
Dxe
Library
Library.c
Generated on Fri Nov 15 2024 18:01:10 for TianoCore EDK2 by
1.9.6