diff options
author | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-02-18 07:28:27 +0000 |
---|---|---|
committer | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-02-18 07:28:27 +0000 |
commit | 404d4e5c6070f75863d465419570b973fba5ac8a (patch) | |
tree | 4bfdb4f2cf55c1f9e7ff6f5b40df344ae1cb059b /IntelFrameworkModulePkg/Library | |
parent | f9619f52afd5fbca4286fefc5eb7f3218085b3ab (diff) | |
download | edk2-platforms-404d4e5c6070f75863d465419570b973fba5ac8a.tar.xz |
Update the library to compliant with SMMCis 0.91 and 0.9 both. 0.91 requires the InSmm() could not be invoked in runtime.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4699 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library')
-rw-r--r-- | IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c index f9537211d7..fae6df1041 100644 --- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c +++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeSupport.c @@ -30,7 +30,7 @@ STATIC EFI_STATUS_CODE_DATA *mStatusCodeData;
STATIC
-EFI_SMM_BASE_PROTOCOL *mSmmBase;
+BOOLEAN mInSmm;
STATIC
EFI_RUNTIME_SERVICES *mRT;
@@ -50,16 +50,11 @@ InternalGetReportStatusCode ( )
{
EFI_STATUS_CODE_PROTOCOL *StatusCodeProtocol;
- BOOLEAN InSmm;
EFI_STATUS Status;
- if (mSmmBase) {
- mSmmBase->InSmm (mSmmBase, &InSmm);
- if (InSmm) {
- return (EFI_REPORT_STATUS_CODE) OemHookStatusCodeReport;
- }
- }
- if (mRT->Hdr.Revision < 0x20000) {
+ if (mInSmm) {
+ return (EFI_REPORT_STATUS_CODE) OemHookStatusCodeReport;
+ } else if (mRT->Hdr.Revision < 0x20000) {
return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)mRT)->ReportStatusCode;
} else if (!mHaveExitedBootServices) {
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);
@@ -89,9 +84,6 @@ ReportStatusCodeLibVirtualAddressChange ( if (NULL != mReportStatusCode) {
mRT->ConvertPointer (0, (VOID **) &mReportStatusCode);
}
- if (NULL != mSmmBase) {
- mRT->ConvertPointer (0, (VOID **) &mSmmBase);
- }
mRT->ConvertPointer (0, (VOID **) &mStatusCodeData);
mRT->ConvertPointer (0, (VOID **) &mRT);
}
@@ -128,20 +120,20 @@ ReportStatusCodeLibConstruct ( IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- BOOLEAN InSmm;
+ EFI_SMM_BASE_PROTOCOL *SmmBase;
+ EFI_STATUS Status;
//
// 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 **) &mSmmBase);
+ Status = gBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, (VOID **) &SmmBase);
if (!EFI_ERROR (Status)) {
- mSmmBase->InSmm (mSmmBase, &InSmm);
- if (InSmm) {
- Status = mSmmBase->SmmAllocatePool (
- mSmmBase,
+ SmmBase->InSmm (SmmBase, &mInSmm);
+ if (mInSmm) {
+ Status = SmmBase->SmmAllocatePool (
+ SmmBase,
EfiRuntimeServicesData,
sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE,
(VOID **) &mStatusCodeData
@@ -156,7 +148,8 @@ ReportStatusCodeLibConstruct ( // Library should not use the gRT directly, since it
// may be converted by other library instance.
//
- mRT = gRT;
+ mRT = gRT;
+ mInSmm = FALSE;
gBS->AllocatePool (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE, (VOID **)&mStatusCodeData);
ASSERT (NULL != mStatusCodeData);
|