Fixed the issue in RuntimeStatusCode library that may not work on the early dispatched Runtime driver.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12073 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
API implementation for instance of Report Status Code Library.
|
API implementation for instance of Report Status Code Library.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL;
|
EFI_STATUS_CODE_PROTOCOL *mReportStatusCodeLibStatusCodeProtocol = NULL;
|
||||||
EFI_EVENT mReportStatusCodeLibVirtualAddressChangeEvent;
|
EFI_EVENT mReportStatusCodeLibVirtualAddressChangeEvent;
|
||||||
|
EFI_EVENT mReportStatusCodeLibExitBootServicesEvent;
|
||||||
|
BOOLEAN mHaveExitedBootServices = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Locate the report status code service.
|
Locate the report status code service.
|
||||||
@ -47,7 +49,7 @@ InternalGetReportStatusCode (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EfiAtRuntime ()) {
|
if (mHaveExitedBootServices) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +84,28 @@ ReportStatusCodeLibVirtualAddressChange (
|
|||||||
EfiConvertPointer (0, (VOID **) &mReportStatusCodeLibStatusCodeProtocol);
|
EfiConvertPointer (0, (VOID **) &mReportStatusCodeLibStatusCodeProtocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Locate the report status code service before enter runtime.
|
||||||
|
//
|
||||||
|
InternalGetReportStatusCode ();
|
||||||
|
|
||||||
|
mHaveExitedBootServices = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The constructor function of Runtime DXE Report Status Code Lib.
|
The constructor function of Runtime DXE Report Status Code Lib.
|
||||||
|
|
||||||
@ -121,6 +145,19 @@ ReportStatusCodeLibConstructor (
|
|||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Register notify function for EVT_SIGNAL_EXIT_BOOT_SERVICES
|
||||||
|
//
|
||||||
|
Status = gBS->CreateEventEx (
|
||||||
|
EVT_NOTIFY_SIGNAL,
|
||||||
|
TPL_NOTIFY,
|
||||||
|
ReportStatusCodeLibExitBootServices,
|
||||||
|
NULL,
|
||||||
|
&gEfiEventExitBootServicesGuid,
|
||||||
|
&mReportStatusCodeLibExitBootServicesEvent
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,6 +186,9 @@ ReportStatusCodeLibDestructor (
|
|||||||
Status = gBS->CloseEvent (mReportStatusCodeLibVirtualAddressChangeEvent);
|
Status = gBS->CloseEvent (mReportStatusCodeLibVirtualAddressChangeEvent);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
Status = gBS->CloseEvent (mReportStatusCodeLibExitBootServicesEvent);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +626,7 @@ ReportStatusCodeEx (
|
|||||||
ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
|
ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
|
||||||
ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
|
ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
|
||||||
|
|
||||||
if (EfiAtRuntime ()) {
|
if (mHaveExitedBootServices) {
|
||||||
if (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
if (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
@ -634,7 +674,7 @@ ReportStatusCodeEx (
|
|||||||
//
|
//
|
||||||
// Free the allocated buffer
|
// Free the allocated buffer
|
||||||
//
|
//
|
||||||
if (!EfiAtRuntime()) {
|
if (!mHaveExitedBootServices) {
|
||||||
gBS->FreePool (StatusCodeData);
|
gBS->FreePool (StatusCodeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# Report status code library instance which supports logging message in DXE & runtime phase.
|
# Report status code library instance which supports logging message in DXE & runtime phase.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -48,6 +48,7 @@
|
|||||||
gEfiStatusCodeSpecificDataGuid ## CONSUMES
|
gEfiStatusCodeSpecificDataGuid ## CONSUMES
|
||||||
gEfiStatusCodeDataTypeDebugGuid ## CONSUMES
|
gEfiStatusCodeDataTypeDebugGuid ## CONSUMES
|
||||||
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event
|
gEfiEventVirtualAddressChangeGuid ## CONSUMES ## Event
|
||||||
|
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiStatusCodeRuntimeProtocolGuid ## CONSUMES
|
gEfiStatusCodeRuntimeProtocolGuid ## CONSUMES
|
||||||
|
Reference in New Issue
Block a user