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
This commit is contained in:
hhuan13
2010-03-10 07:15:40 +00:00
parent a1bd217a5d
commit 1fafcca8b4
3 changed files with 47 additions and 3 deletions

View File

@@ -84,6 +84,26 @@ SmmControl2Clear (
return mSmmControl->Clear (mSmmControl, Periodic);
}
/**
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.
@@ -101,6 +121,7 @@ SmmControl2ThunkMain (
)
{
EFI_STATUS Status;
EFI_EVENT Event;
EFI_SMM_CONTROL_REGISTER RegisterInfo;
///
@@ -115,6 +136,20 @@ SmmControl2ThunkMain (
ASSERT_EFI_ERROR (Status);
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
///