summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h1
-rw-r--r--MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf2
-rw-r--r--MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeSupport.c52
3 files changed, 11 insertions, 44 deletions
diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h
index 38e69d2343..2ae0be4fd3 100644
--- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h
+++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h
@@ -25,6 +25,7 @@
#include <Library/DevicePathLib.h>
#include <Library/OemHookStatusCodeLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiRuntimeLib.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Guid/StatusCodeDataTypeDebug.h>
diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
index 221ea74c14..5ba91064c0 100644
--- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
+++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
@@ -48,11 +48,11 @@
OemHookStatusCodeLib
DevicePathLib
MemoryAllocationLib
+ UefiRuntimeLib
[Guids]
gEfiStatusCodeSpecificDataGuid ## CONSUMES
gEfiStatusCodeDataTypeDebugGuid ## CONSUMES
- gEfiEventExitBootServicesGuid ## CONSUMES ## Event
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event
diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeSupport.c b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeSupport.c
index 9ebf972213..fd9f8f7a2e 100644
--- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeSupport.c
+++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeSupport.c
@@ -14,11 +14,9 @@
#include "ReportStatusCodeLibInternal.h"
-EFI_EVENT mVirtualAddressChangeEvent;
-EFI_EVENT mExitBootServicesEvent;
+EFI_EVENT mStatusCodeVirtualAddressChangeEvent;
EFI_STATUS_CODE_DATA *mStatusCodeData;
-EFI_RUNTIME_SERVICES *mInternalRT;
-BOOLEAN mHaveExitedBootServices = FALSE;
+EFI_RUNTIME_SERVICES *mStatusCodeInternalRT;
EFI_REPORT_STATUS_CODE mReportStatusCode = NULL;
/**
@@ -39,7 +37,7 @@ InternalGetReportStatusCode (
EFI_STATUS_CODE_PROTOCOL *StatusCodeProtocol;
EFI_STATUS Status;
- if (!mHaveExitedBootServices) {
+ if (!EfiAtRuntime ()) {
//
// Check gBS just in case. ReportStatusCode is called before gBS is initialized.
//
@@ -122,27 +120,10 @@ ReportStatusCodeLibVirtualAddressChange (
)
{
if (mReportStatusCode != NULL) {
- mInternalRT->ConvertPointer (0, (VOID **) &mReportStatusCode);
+ mStatusCodeInternalRT->ConvertPointer (0, (VOID **) &mReportStatusCode);
}
- mInternalRT->ConvertPointer (0, (VOID **) &mStatusCodeData);
- mInternalRT->ConvertPointer (0, (VOID **) &mInternalRT);
-}
-
-/**
- Notification function of EVT_SIGNAL_EXIT_BOOT_SERVICES.
-
- @param Event Event whose notification function is being invoked.
- @param Context Pointer to the notification function's context
-
-**/
-VOID
-EFIAPI
-ReportStatusCodeLibExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- mHaveExitedBootServices = TRUE;
+ mStatusCodeInternalRT->ConvertPointer (0, (VOID **) &mStatusCodeData);
+ mStatusCodeInternalRT->ConvertPointer (0, (VOID **) &mStatusCodeInternalRT);
}
/**
@@ -169,7 +150,7 @@ ReportStatusCodeLibConstruct (
//
// Library should not use the gRT directly, for it may be converted by other library instance.
//
- mInternalRT = gRT;
+ mStatusCodeInternalRT = gRT;
mStatusCodeData = AllocateRuntimePool (sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE);
ASSERT (mStatusCodeData != NULL);
@@ -187,20 +168,7 @@ ReportStatusCodeLibConstruct (
ReportStatusCodeLibVirtualAddressChange,
NULL,
&gEfiEventVirtualAddressChangeGuid,
- &mVirtualAddressChangeEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Register notify function for EVT_SIGNAL_EXIT_BOOT_SERVICES
- //
- Status = gBS->CreateEventEx (
- EVT_NOTIFY_SIGNAL,
- TPL_NOTIFY,
- ReportStatusCodeLibExitBootServices,
- NULL,
- &gEfiEventExitBootServicesGuid,
- &mExitBootServicesEvent
+ &mStatusCodeVirtualAddressChangeEvent
);
ASSERT_EFI_ERROR (Status);
@@ -229,9 +197,7 @@ ReportStatusCodeLibDestruct (
EFI_STATUS Status;
ASSERT (gBS != NULL);
- Status = gBS->CloseEvent (mVirtualAddressChangeEvent);
- ASSERT_EFI_ERROR (Status);
- Status = gBS->CloseEvent (mExitBootServicesEvent);
+ Status = gBS->CloseEvent (mStatusCodeVirtualAddressChangeEvent);
ASSERT_EFI_ERROR (Status);
FreePool (mStatusCodeData);