--- /dev/null
+/** @file\r
+ Framework SMM Status Code Protocol on PI SMM Status Code Protocol Thunk.\r
+\r
+ This thunk driver locates PI SMM Status Code Protocol in the SMM protocol database and\r
+ installs it in the UEFI protocol database.\r
+\r
+ Note that Framework SMM Status Code Protocol and PI SMM Status Code Protocol have identical protocol\r
+ GUID and interface structure, but they are in different handle databases.\r
+\r
+ Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials are licensed and made available under \r
+ the terms and conditions of the BSD License that accompanies this distribution. \r
+ The 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 <PiSmm.h>\r
+\r
+#include <Protocol/SmmStatusCode.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/SmmServicesTableLib.h>\r
+\r
+/**\r
+ Entry point of this thunk driver.\r
+\r
+ @param ImageHandle The firmware allocated handle for the EFI image.\r
+ @param SystemTable A pointer to the EFI System Table.\r
+ \r
+ @retval EFI_SUCCESS The entry point is executed successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmmStatusCodeThunkMain (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE Handle;\r
+ EFI_SMM_STATUS_CODE_PROTOCOL *SmmStatusCode;\r
+\r
+ //\r
+ // Locate the PI SMM Status Code Protocol in the SMM protocol database.\r
+ //\r
+ Status = gSmst->SmmLocateProtocol (\r
+ &gEfiSmmStatusCodeProtocolGuid,\r
+ NULL,\r
+ (VOID **)&SmmStatusCode\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ //\r
+ // Install the PI SMM Status Code Protocol into the UEFI protocol database.\r
+ //\r
+ Handle = NULL;\r
+ Status = SystemTable->BootServices->InstallProtocolInterface (\r
+ &Handle,\r
+ &gEfiSmmStatusCodeProtocolGuid,\r
+ EFI_NATIVE_INTERFACE,\r
+ SmmStatusCode\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+## @file\r
+# Framework SMM Status Code Protocol on PI SMM Status Code 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 of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\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
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = FrameworkSmmStatusCodeOnPiSmmStatusCodeThunk\r
+ FILE_GUID = 88B49226-A63F-4505-9D3C-B5A67B846133\r
+ MODULE_TYPE = DXE_SMM_DRIVER\r
+ PI_SPECIFICATION_VERSION = 0x0001000A\r
+ ENTRY_POINT = SmmStatusCodeThunkMain\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
+ FrameworkSmmStatusCodeOnPiSmmStatusCodeThunk.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+ UefiDriverEntryPoint\r
+ SmmServicesTableLib\r
+ DebugLib\r
+ BaseLib\r
+\r
+[Protocols]\r
+ gEfiSmmStatusCodeProtocolGuid ## PRODUCES/CONSUMES\r
+\r
+[Depex]\r
+ gEfiSmmStatusCodeProtocolGuid\r
+\r