summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-25 09:23:44 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-25 09:23:44 +0000
commitbade9bf5b274d379aa8ae579b9b34819102e10d4 (patch)
tree51cd4cacdcd6b1624d1bc71d5db5a382fc483661 /EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk
parentd555d90ff71366e69d91851eb176297391e93704 (diff)
downloadedk2-platforms-bade9bf5b274d379aa8ae579b9b34819102e10d4.tar.xz
Fix the bug that SMM Base Protocol.Communicate() does not work.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10067 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk')
-rw-r--r--EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c42
1 files changed, 13 insertions, 29 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
index 942167067d..61e40cc228 100644
--- a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
+++ b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
@@ -160,15 +160,10 @@ SmmBaseHelperService (
mCommunicationData.FunctionData.Status = EFI_UNSUPPORTED;
- if (IsInSmm()) {
+ if ((mCommunicationData.FunctionData.Function != SMMBASE_COMMUNICATE) && IsInSmm()) {
///
/// If in SMM mode, directly call services in SMM Base Helper.
///
- if (mSmmBaseHelperReady == NULL) {
- ASSERT (FALSE);
- return;
- }
-
DataSize = (UINTN)(sizeof (SMMBASE_FUNCTION_DATA));
mSmmBaseHelperReady->ServiceEntry (
NULL,
@@ -178,13 +173,8 @@ SmmBaseHelperService (
);
} else {
///
- /// If in non-SMM mode, call services in SMM Base Helper via SMM Communication Protocol.
+ /// Call services in SMM Base Helper via SMM Communication Protocol.
///
- if (mSmmCommunication == NULL) {
- ASSERT (FALSE);
- return;
- }
-
DataSize = (UINTN)(sizeof (mCommunicationData));
mSmmCommunication->Communicate (
mSmmCommunication,
@@ -291,16 +281,17 @@ SmmBaseCommunicate (
IN OUT UINTN *BufferSize
)
{
- if (mSmmCommunication == NULL) {
- ASSERT (FALSE);
- return EFI_UNSUPPORTED;
- }
+ ///
+ /// Note this is a runtime interface
+ ///
+
+ mCommunicationData.FunctionData.Function = SMMBASE_COMMUNICATE;
+ mCommunicationData.FunctionData.Args.Communicate.ImageHandle = ImageHandle;
+ mCommunicationData.FunctionData.Args.Communicate.CommunicationBuffer = CommunicationBuffer;
+ mCommunicationData.FunctionData.Args.Communicate.SourceSize = BufferSize;
- return mSmmCommunication->Communicate (
- mSmmCommunication,
- CommunicationBuffer,
- BufferSize
- );
+ SmmBaseHelperService ();
+ return mCommunicationData.FunctionData.Status;
}
/**
@@ -451,11 +442,6 @@ SmmBaseGetSmstLocation (
OUT EFI_SMM_SYSTEM_TABLE **Smst
)
{
- if (mSmmBaseHelperReady == NULL) {
- ASSERT (FALSE);
- return EFI_UNSUPPORTED;
- }
-
if (!IsInSmm ()) {
return EFI_UNSUPPORTED;
}
@@ -484,9 +470,7 @@ SmmBaseAddressChangeEvent (
IN VOID *Context
)
{
- if (mSmmCommunication != NULL) {
- EfiConvertPointer (0x0, (VOID **) &mSmmCommunication);
- }
+ EfiConvertPointer (0x0, (VOID **) &mSmmCommunication);
}
/**