]>
Commit | Line | Data |
---|---|---|
2b8999e1 | 1 | /** @file\r |
2 | Framework SMM Status Code Protocol on PI SMM Status Code Protocol Thunk.\r | |
3 | \r | |
4 | This thunk driver locates PI SMM Status Code Protocol in the SMM protocol database and\r | |
5 | installs it in the UEFI protocol database.\r | |
6 | \r | |
7 | Note that Framework SMM Status Code Protocol and PI SMM Status Code Protocol have identical protocol\r | |
8 | GUID and interface structure, but they are in different handle databases.\r | |
9 | \r | |
10 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
11 | This program and the accompanying materials are licensed and made available under \r | |
12 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
13 | The full text of the license may be found at\r | |
14 | http://opensource.org/licenses/bsd-license.php. \r | |
15 | \r | |
16 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
17 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #include <PiSmm.h>\r | |
22 | \r | |
23 | #include <Protocol/SmmStatusCode.h>\r | |
24 | \r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/UefiDriverEntryPoint.h>\r | |
27 | #include <Library/SmmServicesTableLib.h>\r | |
28 | \r | |
29 | /**\r | |
30 | Entry point of this thunk driver.\r | |
31 | \r | |
32 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
33 | @param SystemTable A pointer to the EFI System Table.\r | |
34 | \r | |
35 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
36 | \r | |
37 | **/\r | |
38 | EFI_STATUS\r | |
39 | EFIAPI\r | |
40 | SmmStatusCodeThunkMain (\r | |
41 | IN EFI_HANDLE ImageHandle,\r | |
42 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
43 | )\r | |
44 | {\r | |
45 | EFI_STATUS Status;\r | |
46 | EFI_HANDLE Handle;\r | |
47 | EFI_SMM_STATUS_CODE_PROTOCOL *SmmStatusCode;\r | |
48 | \r | |
49 | //\r | |
50 | // Locate the PI SMM Status Code Protocol in the SMM protocol database.\r | |
51 | //\r | |
52 | Status = gSmst->SmmLocateProtocol (\r | |
53 | &gEfiSmmStatusCodeProtocolGuid,\r | |
54 | NULL,\r | |
55 | (VOID **)&SmmStatusCode\r | |
56 | );\r | |
57 | ASSERT_EFI_ERROR (Status);\r | |
58 | \r | |
59 | //\r | |
60 | // Install the PI SMM Status Code Protocol into the UEFI protocol database.\r | |
61 | //\r | |
62 | Handle = NULL;\r | |
63 | Status = SystemTable->BootServices->InstallProtocolInterface (\r | |
64 | &Handle,\r | |
65 | &gEfiSmmStatusCodeProtocolGuid,\r | |
66 | EFI_NATIVE_INTERFACE,\r | |
67 | SmmStatusCode\r | |
68 | );\r | |
69 | ASSERT_EFI_ERROR (Status);\r | |
70 | \r | |
71 | return EFI_SUCCESS;\r | |
72 | }\r |