]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EdkCompatibilityPkg: Add DxeSmmReadyToLockOnExitPmAuthThunk driver
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jul 2011 20:48:04 +0000 (20:48 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jul 2011 20:48:04 +0000 (20:48 +0000)
Signed-off-by: jljusten
Reviewed-by: mdkinney
Reviewed-by: geekboy15a
Reviewed-by: jyao1
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12031 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.c [new file with mode: 0644]
EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.h [new file with mode: 0644]
EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.inf [new file with mode: 0644]
EdkCompatibilityPkg/EdkCompatibilityPkg.dsc

diff --git a/EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.c b/EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.c
new file mode 100644 (file)
index 0000000..6625231
--- /dev/null
@@ -0,0 +1,94 @@
+/** @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
diff --git a/EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.h b/EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.h
new file mode 100644 (file)
index 0000000..00f6f6d
--- /dev/null
@@ -0,0 +1,28 @@
+/** @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
diff --git a/EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.inf b/EdkCompatibilityPkg/Compatibility/DxeSmmReadyToLockOnExitPmAuthThunk/DxeSmmReadyToLockOnExitPmAuthThunk.inf
new file mode 100644 (file)
index 0000000..fddda40
--- /dev/null
@@ -0,0 +1,52 @@
+## @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
index cf8243d2b841393f2af0268b51ce67c8fa92f805..4057192993a540eb04d708a8b570ba981d4a527c 100644 (file)
@@ -289,6 +289,7 @@ define GCC_MACRO                 = -DEFI_SPECIFICATION_VERSION=0x00020000 -DPI_S
   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