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 phase
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_BOOT_SERVICES *mDebugBS;
28
37static
38VOID
39EFIAPI
40UefiDebugLibDebugPortProtocolExitBootServicesCallback (
41 EFI_EVENT Event,
42 VOID *Context
43 )
44{
45 mPostEBS = TRUE;
46 return;
47}
48
60EFIAPI
62 IN EFI_HANDLE ImageHandle,
63 IN EFI_SYSTEM_TABLE *SystemTable
64 )
65{
66 mDebugBS = SystemTable->BootServices;
67
68 mDebugBS->CreateEvent (
69 EVT_SIGNAL_EXIT_BOOT_SERVICES,
70 TPL_NOTIFY,
71 UefiDebugLibDebugPortProtocolExitBootServicesCallback,
72 NULL,
73 &mExitBootServicesEvent
74 );
75
76 return EFI_SUCCESS;
77}
78
89EFIAPI
91 IN EFI_HANDLE ImageHandle,
92 IN EFI_SYSTEM_TABLE *SystemTable
93 )
94{
95 if (mExitBootServicesEvent != NULL) {
96 SystemTable->BootServices->CloseEvent (mExitBootServicesEvent);
97 }
98
99 return EFI_SUCCESS;
100}
#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)