summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-10 08:30:51 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-10 08:30:51 +0000
commitfb03ca1a3e6e9b68c282926715e98cf6dd6c24b5 (patch)
treec18d816bef2c22bd6440bdc8d8e9b084d95fa18b /EdkCompatibilityPkg
parent0cf27ce0788c8703647d72737dab693d76894671 (diff)
downloadedk2-fb03ca1a3e6e9b68c282926715e98cf6dd6c24b5.zip
edk2-fb03ca1a3e6e9b68c282926715e98cf6dd6c24b5.tar.gz
edk2-fb03ca1a3e6e9b68c282926715e98cf6dd6c24b5.tar.bz2
Per Framework SMM CIS spec, SMM Base Protocol.Communicate() is availabe in runtime. In SmmBaseOnSmmBase2Thunk driver, implementation of Communicate() uses SMM Communication Protocol. The thunk driver caches a pointer to SMM Communication Protocol. This pointer needs to be converted on Virtual Address Change Event.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9966 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r--EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c37
-rw-r--r--EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h4
-rw-r--r--EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.inf6
-rw-r--r--EdkCompatibilityPkg/EdkCompatibilityPkg.dsc2
4 files changed, 45 insertions, 4 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
index e7f13d4..085ad0c 100644
--- a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
+++ b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.c
@@ -8,7 +8,7 @@
SMM BASE Protocol can be published immediately after SMM Base2 Protocol is installed to
make SMM Base Protocol.InSmm() as early as possible.
- Copyright (c) 2009 Intel Corporation
+ Copyright (c) 2009 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
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
@@ -457,6 +457,27 @@ SmmBaseHelperReadyProtocolNotification (
}
/**
+ Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
+
+ This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
+ It convers pointer to new virtual address.
+
+ @param Event Event whose notification function is being invoked
+ @param Context Pointer to the notification function's context
+**/
+VOID
+EFIAPI
+SmmBaseAddressChangeEvent (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ if (mSmmCommunication != NULL) {
+ EfiConvertPointer (0x0, (VOID **) &mSmmCommunication);
+ }
+}
+
+/**
Entry Point for SMM Base Protocol on SMM Base2 Protocol Thunk driver.
@param[in] ImageHandle Image handle of this driver.
@@ -471,7 +492,9 @@ SmmBaseThunkMain (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- VOID *Registration;
+ VOID *Registration;
+ EFI_EVENT VirtualAddressChangeEvent;
+ EFI_STATUS Status;
mImageHandle = ImageHandle;
@@ -513,6 +536,16 @@ SmmBaseThunkMain (
&Registration
);
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_NOTIFY,
+ SmmBaseAddressChangeEvent,
+ NULL,
+ &gEfiEventVirtualAddressChangeGuid,
+ &VirtualAddressChangeEvent
+ );
+ ASSERT_EFI_ERROR (Status);
+
return EFI_SUCCESS;
}
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h
index 6fc3f19..ffe6508 100644
--- a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h
+++ b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.h
@@ -1,7 +1,7 @@
/** @file
Include file for SMM Base Protocol on SMM Base2 Protocol Thunk driver.
- Copyright (c) 2009, Intel Corporation
+ Copyright (c) 2009 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
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
@@ -21,7 +21,9 @@
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiLib.h>
+#include <Library/UefiRuntimeLib.h>
#include <Guid/SmmBaseThunkCommunication.h>
+#include <Guid/EventGroup.h>
#include <Protocol/SmmBase2.h>
#include <Protocol/SmmCommunication.h>
#include <Protocol/SmmBaseHelperReady.h>
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.inf b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.inf
index cea74e8..87bf344 100644
--- a/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.inf
+++ b/EdkCompatibilityPkg/Compatibility/SmmBaseOnSmmBase2Thunk/SmmBaseOnSmmBase2Thunk.inf
@@ -1,7 +1,7 @@
## @file
# Component description file for SMM Base Protocol on SMM Base2 Protocol Thunk driver.
#
-# Copyright (c) 2009, Intel Corporation
+# Copyright (c) 2009 - 2010, Intel Corporation
#
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -41,6 +41,10 @@
UefiBootServicesTableLib
DebugLib
UefiLib
+ UefiRuntimeLib
+
+[Guids]
+ gEfiEventVirtualAddressChangeGuid # GUID ALWAYS_CONSUMED
[Protocols]
gEfiSmmBase2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
diff --git a/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc b/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc
index 40e38fc..de02580 100644
--- a/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc
+++ b/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc
@@ -57,6 +57,8 @@ define GCC_MACRO = -DEFI_SPECIFICATION_VERSION=0x00020000 -DPI_S
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
PalLib|MdePkg/Library/BasePalLibNull/BasePalLibNull.inf
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+ UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+ UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf