TianoCore EDK2 master
Loading...
Searching...
No Matches
DebugLibConstructor.c
Go to the documentation of this file.
1
11#include <Uefi.h>
12#include <Library/BaseLib.h>
14
15//
16// BOOLEAN value to indicate if it is at the post ExitBootServices pahse
17//
18BOOLEAN mPostEBS = FALSE;
19
20static EFI_EVENT mExitBootServicesEvent;
21
22//
23// Pointer to SystemTable
24// This library instance may have a cycle consume with UefiBootServicesTableLib
25// because of the constructors.
26//
27EFI_SYSTEM_TABLE *mDebugST;
28
37VOID
38EFIAPI
40 EFI_EVENT Event,
41 VOID *Context
42 )
43{
44 mPostEBS = TRUE;
45 return;
46}
47
59EFIAPI
61 IN EFI_HANDLE ImageHandle,
62 IN EFI_SYSTEM_TABLE *SystemTable
63 )
64{
65 mDebugST = SystemTable;
66
67 SystemTable->BootServices->CreateEvent (
68 EVT_SIGNAL_EXIT_BOOT_SERVICES,
69 TPL_NOTIFY,
71 NULL,
72 &mExitBootServicesEvent
73 );
74
75 return EFI_SUCCESS;
76}
77
88EFIAPI
90 IN EFI_HANDLE ImageHandle,
91 IN EFI_SYSTEM_TABLE *SystemTable
92 )
93{
94 if (mExitBootServicesEvent != NULL) {
95 SystemTable->BootServices->CloseEvent (mExitBootServicesEvent);
96 }
97
98 return EFI_SUCCESS;
99}
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_STATUS EFIAPI DxeDebugLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI DxeDebugLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI ExitBootServicesCallback(EFI_EVENT Event, VOID *Context)
EFI_BOOT_SERVICES * BootServices
Definition: UefiSpec.h:2083