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
This commit is contained in:
		@@ -8,7 +8,7 @@
 | 
				
			|||||||
  SMM BASE Protocol can be published immediately after SMM Base2 Protocol is installed to
 | 
					  SMM BASE Protocol can be published immediately after SMM Base2 Protocol is installed to
 | 
				
			||||||
  make SMM Base Protocol.InSmm() as early as possible.
 | 
					  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
 | 
					  All rights reserved. This program and the accompanying materials
 | 
				
			||||||
  are licensed and made available under the terms and conditions of the BSD License
 | 
					  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
 | 
					  which accompanies this distribution.  The full text of the license may be found at
 | 
				
			||||||
@@ -456,6 +456,27 @@ SmmBaseHelperReadyProtocolNotification (
 | 
				
			|||||||
  gBS->LocateProtocol (&gEfiSmmBaseHelperReadyProtocolGuid, NULL, (VOID **) &mSmmBaseHelperReady);
 | 
					  gBS->LocateProtocol (&gEfiSmmBaseHelperReadyProtocolGuid, NULL, (VOID **) &mSmmBaseHelperReady);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					  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.
 | 
					  Entry Point for SMM Base Protocol on SMM Base2 Protocol Thunk driver.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -472,6 +493,8 @@ SmmBaseThunkMain (
 | 
				
			|||||||
  )
 | 
					  )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  VOID       *Registration;
 | 
					  VOID       *Registration;
 | 
				
			||||||
 | 
					  EFI_EVENT  VirtualAddressChangeEvent;
 | 
				
			||||||
 | 
					  EFI_STATUS Status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  mImageHandle = ImageHandle;
 | 
					  mImageHandle = ImageHandle;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -513,6 +536,16 @@ SmmBaseThunkMain (
 | 
				
			|||||||
    &Registration
 | 
					    &Registration
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status = gBS->CreateEventEx (
 | 
				
			||||||
 | 
					                  EVT_NOTIFY_SIGNAL,
 | 
				
			||||||
 | 
					                  TPL_NOTIFY,
 | 
				
			||||||
 | 
					                  SmmBaseAddressChangeEvent,
 | 
				
			||||||
 | 
					                  NULL,
 | 
				
			||||||
 | 
					                  &gEfiEventVirtualAddressChangeGuid,
 | 
				
			||||||
 | 
					                  &VirtualAddressChangeEvent
 | 
				
			||||||
 | 
					                  );
 | 
				
			||||||
 | 
					  ASSERT_EFI_ERROR (Status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return EFI_SUCCESS;
 | 
					  return EFI_SUCCESS;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
/** @file
 | 
					/** @file
 | 
				
			||||||
  Include file for SMM Base Protocol on SMM Base2 Protocol Thunk driver.
 | 
					  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
 | 
					  All rights reserved. This program and the accompanying materials
 | 
				
			||||||
  are licensed and made available under the terms and conditions of the BSD License
 | 
					  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
 | 
					  which accompanies this distribution.  The full text of the license may be found at
 | 
				
			||||||
@@ -21,7 +21,9 @@
 | 
				
			|||||||
#include <Library/UefiBootServicesTableLib.h>
 | 
					#include <Library/UefiBootServicesTableLib.h>
 | 
				
			||||||
#include <Library/UefiDriverEntryPoint.h>
 | 
					#include <Library/UefiDriverEntryPoint.h>
 | 
				
			||||||
#include <Library/UefiLib.h>
 | 
					#include <Library/UefiLib.h>
 | 
				
			||||||
 | 
					#include <Library/UefiRuntimeLib.h>
 | 
				
			||||||
#include <Guid/SmmBaseThunkCommunication.h>
 | 
					#include <Guid/SmmBaseThunkCommunication.h>
 | 
				
			||||||
 | 
					#include <Guid/EventGroup.h>
 | 
				
			||||||
#include <Protocol/SmmBase2.h>
 | 
					#include <Protocol/SmmBase2.h>
 | 
				
			||||||
#include <Protocol/SmmCommunication.h>
 | 
					#include <Protocol/SmmCommunication.h>
 | 
				
			||||||
#include <Protocol/SmmBaseHelperReady.h>
 | 
					#include <Protocol/SmmBaseHelperReady.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
## @file
 | 
					## @file
 | 
				
			||||||
#  Component description file for SMM Base Protocol on SMM Base2 Protocol Thunk driver.
 | 
					#  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
 | 
					#  All rights reserved. This program and the accompanying materials
 | 
				
			||||||
#  are licensed and made available under the terms and conditions of the BSD License
 | 
					#  are licensed and made available under the terms and conditions of the BSD License
 | 
				
			||||||
@@ -41,6 +41,10 @@
 | 
				
			|||||||
  UefiBootServicesTableLib
 | 
					  UefiBootServicesTableLib
 | 
				
			||||||
  DebugLib
 | 
					  DebugLib
 | 
				
			||||||
  UefiLib
 | 
					  UefiLib
 | 
				
			||||||
 | 
					  UefiRuntimeLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Guids]
 | 
				
			||||||
 | 
					  gEfiEventVirtualAddressChangeGuid   # GUID ALWAYS_CONSUMED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Protocols]
 | 
					[Protocols]
 | 
				
			||||||
  gEfiSmmBase2ProtocolGuid            # PROTOCOL SOMETIMES_CONSUMED
 | 
					  gEfiSmmBase2ProtocolGuid            # PROTOCOL SOMETIMES_CONSUMED
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,6 +57,8 @@ define GCC_MACRO                 = -DEFI_SPECIFICATION_VERSION=0x00020000 -DPI_S
 | 
				
			|||||||
  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
 | 
					  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
 | 
				
			||||||
  PalLib|MdePkg/Library/BasePalLibNull/BasePalLibNull.inf
 | 
					  PalLib|MdePkg/Library/BasePalLibNull/BasePalLibNull.inf
 | 
				
			||||||
  UefiLib|MdePkg/Library/UefiLib/UefiLib.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
 | 
					  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
 | 
				
			||||||
  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
 | 
					  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
 | 
				
			||||||
  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
 | 
					  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user