--- /dev/null
+/** @file\r
+ DxeSmmReadyToLock Protocol on ExitPmAuth Protocol Thunk driver.\r
+ R8 platform uses ExitPmAuth point to lock SMRAM and SMM API.\r
+ But R9 uses DxeSmmReadyToLock. We need a thunk driver to convert this event.\r
+\r
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions\r
+of the BSD License which accompanies this distribution. The\r
+full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "DxeSmmReadyToLockOnExitPmAuthThunk.h"\r
+\r
+/**\r
+ ExitPmAuth Protocol notification event handler.\r
+\r
+ @param[in] Event Event whose notification function is being invoked.\r
+ @param[in] Context Pointer to the notification function's context.\r
+**/\r
+VOID\r
+EFIAPI\r
+ExitPmAuthProtocolNotification (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE ImageHandle;\r
+ VOID *ExitPmAuth;\r
+\r
+ //\r
+ // Add more check to locate protocol after got event, because\r
+ // R8 ECP will signal this event immediately once it is register\r
+ // just in case it is already installed.\r
+ //\r
+ Status = gBS->LocateProtocol (\r
+ &gExitPmAuthProtocolGuid,\r
+ NULL,\r
+ &ExitPmAuth\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return ;\r
+ }\r
+\r
+ //\r
+ // Install DxeSmmReadyToLock protocol to let PI SMM lock\r
+ //\r
+ ImageHandle = NULL;\r
+ Status = gBS->InstallProtocolInterface (\r
+ &ImageHandle,\r
+ &gEfiDxeSmmReadyToLockProtocolGuid,\r
+ EFI_NATIVE_INTERFACE,\r
+ NULL\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+}\r
+\r
+/**\r
+ Entry Point for DxeSmmReadyToLock Protocol on ExitPmAuth Protocol Thunk driver.\r
+\r
+ @param[in] ImageHandle Image handle of this driver.\r
+ @param[in] SystemTable A Pointer to the EFI System Table.\r
+\r
+ @retval EFI_SUCCESS The entry point is executed successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeSmmReadyToLockMain (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ VOID *Registration;\r
+\r
+ //\r
+ // Install notifications for required protocols\r
+ //\r
+ EfiCreateProtocolNotifyEvent (\r
+ &gExitPmAuthProtocolGuid,\r
+ TPL_CALLBACK,\r
+ ExitPmAuthProtocolNotification,\r
+ NULL,\r
+ &Registration\r
+ );\r
+\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+/** @file\r
+ Include file for DxeSmmReadyToLock Protocol on ExitPmAuth Protocol Thunk driver.\r
+\r
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions\r
+of the BSD License which accompanies this distribution. The\r
+full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _DXE_SMM_READY_TO_LOCK_ON_EXIT_PMAUTH_THUNK_H_\r
+#define _DXE_SMM_READY_TO_LOCK_ON_EXIT_PMAUTH_THUNK_H_\r
+\r
+#include <PiDxe.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiLib.h>\r
+#include <Protocol/DxeSmmReadyToLock.h>\r
+#include <Protocol/ExitPmAuth.h>\r
+\r
+#endif \r
--- /dev/null
+## @file\r
+# Component description file for DxeSmmReadyToLock Protocol on\r
+# ExitPmAuth Protocol Thunk driver.\r
+#\r
+# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions\r
+# of the BSD License which accompanies this distribution. The\r
+# full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = DxeSmmReadyToLockOnExitPmAuthThunk\r
+ FILE_GUID = 82ECEE48-9571-4427-8485-85A5A45A0F39\r
+ MODULE_TYPE = DXE_DRIVER\r
+ VERSION_STRING = 1.0\r
+ ENTRY_POINT = DxeSmmReadyToLockMain\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64\r
+#\r
+\r
+[Sources]\r
+ DxeSmmReadyToLockOnExitPmAuthThunk.c\r
+ DxeSmmReadyToLockOnExitPmAuthThunk.h\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ EdkCompatibilityPkg/EdkCompatibilityPkg.dec\r
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ UefiDriverEntryPoint\r
+ UefiBootServicesTableLib\r
+ DebugLib\r
+ UefiLib\r
+\r
+[Protocols]\r
+ gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_PRODUCED\r
+ gExitPmAuthProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
+\r
+[Depex]\r
+ TRUE\r
EdkCompatibilityPkg/Compatibility/PiSmmStatusCodeOnFrameworkSmmStatusCodeThunk/PiSmmStatusCodeOnFrameworkSmmStatusCodeThunk.inf\r
EdkCompatibilityPkg/Compatibility/FrameworkSmmStatusCodeOnPiSmmStatusCodeThunk/FrameworkSmmStatusCodeOnPiSmmStatusCodeThunk.inf\r
EdkCompatibilityPkg/Compatibility/BootScriptSaveOnS3SaveStateThunk/BootScriptSaveOnS3SaveStateThunk.inf\r
+ EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.inf\r
\r
[Components.IPF]\r
EdkCompatibilityPkg/Foundation/Cpu/Itanium/CpuIa64Lib/CpuIA64Lib.inf\r