]>
Commit | Line | Data |
---|---|---|
caf93abc | 1 | /** @file\r |
2 | DxeSmmReadyToLock Protocol on ExitPmAuth Protocol Thunk driver.\r | |
8598a1ed RN |
3 | EDK platform uses ExitPmAuth point to lock SMRAM and SMM API.\r |
4 | But EDKII uses DxeSmmReadyToLock. We need a thunk driver to convert this event.\r | |
caf93abc | 5 | \r |
8598a1ed | 6 | Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r |
caf93abc | 7 | \r |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions\r | |
10 | of the BSD License which accompanies this distribution. The\r | |
11 | full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | \r | |
17 | **/\r | |
18 | \r | |
19 | #include "DxeSmmReadyToLockOnExitPmAuthThunk.h"\r | |
20 | \r | |
21 | /**\r | |
22 | ExitPmAuth Protocol notification event handler.\r | |
23 | \r | |
24 | @param[in] Event Event whose notification function is being invoked.\r | |
25 | @param[in] Context Pointer to the notification function's context.\r | |
26 | **/\r | |
27 | VOID\r | |
28 | EFIAPI\r | |
29 | ExitPmAuthProtocolNotification (\r | |
30 | IN EFI_EVENT Event,\r | |
31 | IN VOID *Context\r | |
32 | )\r | |
33 | {\r | |
34 | EFI_STATUS Status;\r | |
35 | EFI_HANDLE ImageHandle;\r | |
36 | VOID *ExitPmAuth;\r | |
37 | \r | |
38 | //\r | |
39 | // Add more check to locate protocol after got event, because\r | |
8598a1ed | 40 | // ECP will signal this event immediately once it is register\r |
caf93abc | 41 | // just in case it is already installed.\r |
42 | //\r | |
43 | Status = gBS->LocateProtocol (\r | |
44 | &gExitPmAuthProtocolGuid,\r | |
45 | NULL,\r | |
46 | &ExitPmAuth\r | |
47 | );\r | |
48 | if (EFI_ERROR (Status)) {\r | |
49 | return ;\r | |
50 | }\r | |
51 | \r | |
52 | //\r | |
53 | // Install DxeSmmReadyToLock protocol to let PI SMM lock\r | |
54 | //\r | |
55 | ImageHandle = NULL;\r | |
56 | Status = gBS->InstallProtocolInterface (\r | |
57 | &ImageHandle,\r | |
58 | &gEfiDxeSmmReadyToLockProtocolGuid,\r | |
59 | EFI_NATIVE_INTERFACE,\r | |
60 | NULL\r | |
61 | );\r | |
62 | ASSERT_EFI_ERROR (Status);\r | |
63 | }\r | |
64 | \r | |
65 | /**\r | |
66 | Entry Point for DxeSmmReadyToLock Protocol on ExitPmAuth Protocol Thunk driver.\r | |
67 | \r | |
68 | @param[in] ImageHandle Image handle of this driver.\r | |
69 | @param[in] SystemTable A Pointer to the EFI System Table.\r | |
70 | \r | |
71 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
72 | **/\r | |
73 | EFI_STATUS\r | |
74 | EFIAPI\r | |
75 | DxeSmmReadyToLockMain (\r | |
76 | IN EFI_HANDLE ImageHandle,\r | |
77 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
78 | )\r | |
79 | {\r | |
80 | VOID *Registration;\r | |
81 | \r | |
82 | //\r | |
83 | // Install notifications for required protocols\r | |
84 | //\r | |
85 | EfiCreateProtocolNotifyEvent (\r | |
86 | &gExitPmAuthProtocolGuid,\r | |
87 | TPL_CALLBACK,\r | |
88 | ExitPmAuthProtocolNotification,\r | |
89 | NULL,\r | |
90 | &Registration\r | |
91 | );\r | |
92 | \r | |
93 | return EFI_SUCCESS;\r | |
94 | }\r |