diff options
author | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-01-22 02:09:25 +0000 |
---|---|---|
committer | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-01-22 02:09:25 +0000 |
commit | b13b447355afb6cbb838bac5da520c73b71ad63b (patch) | |
tree | 1f51775f12eb07b84437f70ab39052e2f7999af6 /IntelFrameworkModulePkg | |
parent | 6178919748ecbe78fcde282a7f6b49bac4fe4243 (diff) | |
download | edk2-platforms-b13b447355afb6cbb838bac5da520c73b71ad63b.tar.xz |
Runtime Library should not use the gRT directly, since it may be converted to virtual address by other library instance.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4604 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c index b632a94a1a..f9537211d7 100644 --- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c +++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c @@ -33,6 +33,9 @@ STATIC EFI_SMM_BASE_PROTOCOL *mSmmBase;
STATIC
+EFI_RUNTIME_SERVICES *mRT;
+
+STATIC
BOOLEAN mHaveExitedBootServices = FALSE;
/**
@@ -56,8 +59,8 @@ InternalGetReportStatusCode ( return (EFI_REPORT_STATUS_CODE) OemHookStatusCodeReport;
}
}
- if (gRT->Hdr.Revision < 0x20000) {
- return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;
+ if (mRT->Hdr.Revision < 0x20000) {
+ return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)mRT)->ReportStatusCode;
} else if (!mHaveExitedBootServices) {
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);
if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {
@@ -84,13 +87,13 @@ ReportStatusCodeLibVirtualAddressChange ( )
{
if (NULL != mReportStatusCode) {
- gRT->ConvertPointer (0, (VOID **) &mReportStatusCode);
+ mRT->ConvertPointer (0, (VOID **) &mReportStatusCode);
}
if (NULL != mSmmBase) {
- gRT->ConvertPointer (0, (VOID **) &mSmmBase);
+ mRT->ConvertPointer (0, (VOID **) &mSmmBase);
}
- gRT->ConvertPointer (0, (VOID **) &mStatusCodeData);
- gRT->ConvertPointer (0, (VOID **) &gRT);
+ mRT->ConvertPointer (0, (VOID **) &mStatusCodeData);
+ mRT->ConvertPointer (0, (VOID **) &mRT);
}
/**
@@ -149,6 +152,12 @@ ReportStatusCodeLibConstruct ( }
}
+ //
+ // Library should not use the gRT directly, since it
+ // may be converted by other library instance.
+ //
+ mRT = gRT;
+
gBS->AllocatePool (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE, (VOID **)&mStatusCodeData);
ASSERT (NULL != mStatusCodeData);
//
|