diff options
author | hhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-10 07:15:40 +0000 |
---|---|---|
committer | hhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-10 07:15:40 +0000 |
commit | 1fafcca8b4f0f027638355ef67e2efab2e1d780b (patch) | |
tree | 0aab903a44d26738bb2c7da8522a543058b0c131 /EdkCompatibilityPkg | |
parent | a1bd217a5d5d8a6899921f88a4ce1c06adc21957 (diff) | |
download | edk2-platforms-1fafcca8b4f0f027638355ef67e2efab2e1d780b.tar.xz |
Update this module from DXE_DRIVER to DXE_RUNTIME_DRIVER and convert mSmmControl pointer upon GoVirtual().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10227 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
3 files changed, 47 insertions, 3 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.c b/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.c index 8abd56ecd6..d9ae25c7b9 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.c +++ b/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.c @@ -85,6 +85,26 @@ SmmControl2Clear ( }
/**
+ 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[in] Event Event whose notification function is being invoked.
+ @param[in] Context Pointer to the notification function's context.
+
+**/
+VOID
+EFIAPI
+SetVirtualAddressNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EfiConvertPointer (0x0, (VOID **)&mSmmControl);
+}
+
+/**
Entry Point for this thunk driver.
@param[in] ImageHandle Image handle of this driver.
@@ -101,6 +121,7 @@ SmmControl2ThunkMain ( )
{
EFI_STATUS Status;
+ EFI_EVENT Event;
EFI_SMM_CONTROL_REGISTER RegisterInfo;
///
@@ -116,6 +137,20 @@ SmmControl2ThunkMain ( mDataPort = RegisterInfo.SmiDataRegister;
///
+ /// Create event on SetVirtualAddressMap() to convert mSmmControl from a physical address to a virtual address
+ ///
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_NOTIFY,
+ SetVirtualAddressNotify,
+ NULL,
+ &gEfiEventVirtualAddressChangeGuid,
+ &Event
+ );
+
+ ASSERT_EFI_ERROR (Status);
+
+ ///
/// Publish framework SMM Control Protocol
///
Status = gBS->InstallProtocolInterface (
diff --git a/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.h b/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.h index a74b8299c1..6493731e88 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.h +++ b/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.h @@ -17,12 +17,17 @@ #include <PiDxe.h>
#include <FrameworkSmm.h>
+
+#include <Protocol/SmmControl2.h>
+#include <Protocol/SmmControl.h>
+
+#include <Guid/EventGroup.h>
+
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiRuntimeLib.h>
#include <Library/IoLib.h>
-#include <Protocol/SmmControl2.h>
-#include <Protocol/SmmControl.h>
/**
Invokes SMI activation from either the preboot or runtime environment.
diff --git a/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.inf b/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.inf index fd780297e7..4f770e75b7 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.inf +++ b/EdkCompatibilityPkg/Compatibility/SmmControl2OnSmmControlThunk/SmmControl2OnSmmControlThunk.inf @@ -17,7 +17,7 @@ INF_VERSION = 0x00010005
BASE_NAME = SmmControl2OnSmmControlThunk
FILE_GUID = B55A4515-5895-4ea8-845B-75B7480F6502
- MODULE_TYPE = DXE_DRIVER
+ MODULE_TYPE = DXE_RUNTIME_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = SmmControl2ThunkMain
@@ -39,6 +39,7 @@ [LibraryClasses]
UefiDriverEntryPoint
UefiBootServicesTableLib
+ UefiRuntimeLib
DebugLib
IoLib
@@ -46,6 +47,9 @@ gEfiSmmControlProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSmmControl2ProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+[Guids]
+ gEfiEventVirtualAddressChangeGuid # GUID ALWAYS_CONSUMED
+
[Depex]
gEfiSmmControlProtocolGuid
|