summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-19 09:35:46 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-19 09:35:46 +0000
commite12848a3a3b8ae1470cdf53ba30a8c29c70fee51 (patch)
tree8e1b28914dde7916bc1bf14109e62499934c324a /IntelFrameworkModulePkg
parent4a733414845959bb0de046130c5659d9900da6f7 (diff)
downloadedk2-e12848a3a3b8ae1470cdf53ba30a8c29c70fee51.tar.gz
edk2-e12848a3a3b8ae1470cdf53ba30a8c29c70fee51.tar.bz2
edk2-e12848a3a3b8ae1470cdf53ba30a8c29c70fee51.zip
[Description]:
The patch enhances the SmmRuntimeDxeReportStatusCodeLibFramework instance to reduce the library dependency, since DebugLib, UefiBootServicesTableLib and original SmmRuntimeDxeReportStatusCodeLibFramework may result in the circular dependency. [Impaction]: It is backward-compatible. [Reference Info]: N/A git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4919 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h2
-rw-r--r--IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeReportStatusCodeLibFramework.inf1
-rw-r--r--IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c25
3 files changed, 15 insertions, 13 deletions
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
index d2dc4c615e..de0dab9f4a 100644
--- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
+++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
@@ -19,7 +19,6 @@
#include <Library/ReportStatusCodeLib.h>
#include <Library/DebugLib.h>
-#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PcdLib.h>
@@ -31,7 +30,6 @@
#include <FrameworkModuleBase.h>
#include <DebugInfo.h>
-
/**
Locatet he report status code service.
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeReportStatusCodeLibFramework.inf b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeReportStatusCodeLibFramework.inf
index 09d73459b1..c2b5646cde 100644
--- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeReportStatusCodeLibFramework.inf
+++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeReportStatusCodeLibFramework.inf
@@ -47,7 +47,6 @@
PcdLib
BaseMemoryLib
BaseLib
- UefiBootServicesTableLib
DebugLib
UefiRuntimeServicesTableLib
OemHookStatusCodeLib
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c
index fae6df1041..882cad677f 100644
--- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c
+++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c
@@ -36,6 +36,9 @@ STATIC
EFI_RUNTIME_SERVICES *mRT;
STATIC
+EFI_BOOT_SERVICES *mBS;
+
+STATIC
BOOLEAN mHaveExitedBootServices = FALSE;
/**
@@ -57,7 +60,7 @@ InternalGetReportStatusCode (
} else if (mRT->Hdr.Revision < 0x20000) {
return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)mRT)->ReportStatusCode;
} else if (!mHaveExitedBootServices) {
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);
+ Status = mBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);
if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {
return StatusCodeProtocol->ReportStatusCode;
}
@@ -123,12 +126,14 @@ ReportStatusCodeLibConstruct (
EFI_SMM_BASE_PROTOCOL *SmmBase;
EFI_STATUS Status;
+ mBS = SystemTable->BootServices;
+
//
// SMM driver depends on the SMM BASE protocol.
// the SMM driver must be success to locate protocol.
//
- ASSERT (gBS != NULL);
- Status = gBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, (VOID **) &SmmBase);
+ ASSERT (mBS != NULL);
+ Status = mBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, (VOID **) &SmmBase);
if (!EFI_ERROR (Status)) {
SmmBase->InSmm (SmmBase, &mInSmm);
if (mInSmm) {
@@ -151,7 +156,7 @@ ReportStatusCodeLibConstruct (
mRT = gRT;
mInSmm = FALSE;
- gBS->AllocatePool (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE, (VOID **)&mStatusCodeData);
+ mBS->AllocatePool (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE, (VOID **)&mStatusCodeData);
ASSERT (NULL != mStatusCodeData);
//
// Cache the report status code service
@@ -161,7 +166,7 @@ ReportStatusCodeLibConstruct (
//
// Register the call back of virtual address change
//
- Status = gBS->CreateEvent (
+ Status = mBS->CreateEvent (
EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
TPL_NOTIFY,
ReportStatusCodeLibVirtualAddressChange,
@@ -174,7 +179,7 @@ ReportStatusCodeLibConstruct (
//
// Register the call back of virtual address change
//
- Status = gBS->CreateEvent (
+ Status = mBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
ReportStatusCodeLibExitBootServices,
@@ -199,13 +204,13 @@ ReportStatusCodeLibDestruct (
//
// Close SetVirtualAddressMap () notify function
//
- ASSERT (gBS != NULL);
- Status = gBS->CloseEvent (mVirtualAddressChangeEvent);
+ ASSERT (mBS != NULL);
+ Status = mBS->CloseEvent (mVirtualAddressChangeEvent);
ASSERT_EFI_ERROR (Status);
- Status = gBS->CloseEvent (mExitBootServicesEvent);
+ Status = mBS->CloseEvent (mExitBootServicesEvent);
ASSERT_EFI_ERROR (Status);
- gBS->FreePool (mStatusCodeData);
+ mBS->FreePool (mStatusCodeData);
return Status;
}