TianoCore EDK2 master
Loading...
Searching...
No Matches
VariablePolicyExtraInitRuntimeDxe.c
1
12
13extern EFI_GET_VARIABLE mGetVariableHelper;
14extern UINT8 *mPolicyTable;
15STATIC BOOLEAN mIsVirtualAddrConverted;
16STATIC EFI_EVENT mVariablePolicyLibVirtualAddressChangeEvent = NULL;
17
26VOID
27EFIAPI
28VariablePolicyLibVirtualAddressCallback (
29 IN EFI_EVENT Event,
30 IN VOID *Context
31 )
32{
33 gRT->ConvertPointer (0, (VOID **)&mPolicyTable);
34 gRT->ConvertPointer (0, (VOID **)&mGetVariableHelper);
35 mIsVirtualAddrConverted = TRUE;
36}
37
47VariablePolicyExtraInit (
48 VOID
49 )
50{
51 return gBS->CreateEventEx (
52 EVT_NOTIFY_SIGNAL,
53 TPL_NOTIFY,
54 VariablePolicyLibVirtualAddressCallback,
55 NULL,
56 &gEfiEventVirtualAddressChangeGuid,
57 &mVariablePolicyLibVirtualAddressChangeEvent
58 );
59}
60
70VariablePolicyExtraDeinit (
71 VOID
72 )
73{
74 EFI_STATUS Status;
75
76 Status = EFI_SUCCESS;
77 if (mIsVirtualAddrConverted) {
78 Status = gBS->CloseEvent (mVariablePolicyLibVirtualAddressChangeEvent);
79 } else {
80 Status = EFI_SUCCESS;
81 }
82
83 return Status;
84}
EFI_RUNTIME_SERVICES * gRT
#define NULL
Definition: Base.h:319
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define IN
Definition: Base.h:279
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_STATUS(EFIAPI * EFI_GET_VARIABLE)(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL)
Definition: UefiSpec.h:696