]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiSmmDriverLib.h
Enhance TPM driver to protect TPM physical presence flags.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / EfiSmmDriverLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
8598a1ed 3Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
4ea9375a 4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 EfiSmmDriverLib.h\r
15\r
16Abstract:\r
17\r
18 Light weight lib to support EFI Smm drivers.\r
19\r
20--*/\r
21\r
22#ifndef _EFI_SMM_DRIVER_LIB_H_\r
23#define _EFI_SMM_DRIVER_LIB_H_\r
24\r
25#include "Tiano.h"\r
26#include "GetImage.h"\r
27#include "EfiCommonLib.h"\r
28#include EFI_GUID_DEFINITION (EventLegacyBios)\r
29#include EFI_GUID_DEFINITION (EventGroup)\r
30#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)\r
31#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)\r
32#include EFI_PROTOCOL_DEFINITION (SmmBase)\r
33#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)\r
34//\r
35// Driver Lib Globals.\r
36//\r
37extern EFI_BOOT_SERVICES *gBS;\r
38extern EFI_SYSTEM_TABLE *gST;\r
39extern EFI_RUNTIME_SERVICES *gRT;\r
40extern EFI_SMM_BASE_PROTOCOL *gSMM;\r
41extern EFI_SMM_STATUS_CODE_PROTOCOL *mSmmDebug;\r
42extern UINTN gErrorLevel;\r
43\r
44#define EfiCopyMem EfiCommonLibCopyMem\r
45#define EfiSetMem EfiCommonLibSetMem\r
46#define EfiZeroMem EfiCommonLibZeroMem\r
47\r
48EFI_STATUS\r
49EfiInitializeSmmDriverLib (\r
50 IN EFI_HANDLE ImageHandle,\r
51 IN EFI_SYSTEM_TABLE *SystemTable,\r
52 IN OUT BOOLEAN *InSmm\r
53 )\r
54/*++\r
55\r
56Routine Description:\r
57\r
58 Intialize Smm Driver Lib if it has not yet been initialized. \r
59\r
60Arguments:\r
61\r
62 ImageHandle - The firmware allocated handle for the EFI image.\r
63 \r
64 SystemTable - A pointer to the EFI System Table.\r
65 \r
66 InSmm - If InSmm is NULL, it will not register Image to SMM.\r
67 If InSmm is not NULL, it will register Image to SMM and\r
68 return information on currently in SMM mode or not.\r
69\r
70Returns: \r
71\r
72 EFI_STATUS always returns EFI_SUCCESS\r
73\r
74--*/\r
75;\r
76\r
77VOID\r
78EfiDebugAssert (\r
79 IN CHAR8 *FileName,\r
80 IN INTN LineNumber,\r
81 IN CHAR8 *Description\r
82 )\r
83/*++\r
84\r
85Routine Description:\r
86\r
87 Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT\r
88 information. If Error Logging hub is not loaded DEADLOOP ().\r
89 \r
90Arguments:\r
91\r
92 FileName - File name of failing routine.\r
93\r
94 LineNumber - Line number of failing ASSERT().\r
95\r
96 Description - Description, usually the assertion,\r
97 \r
98Returns:\r
99 \r
100 None\r
101\r
102--*/\r
103;\r
104\r
105VOID\r
106EfiDebugVPrint (\r
107 IN UINTN ErrorLevel,\r
108 IN CHAR8 *Format,\r
109 IN VA_LIST Marker\r
110 )\r
111/*++\r
112\r
113Routine Description:\r
114\r
115 Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT\r
116 information. If Error Logging hub is not loaded do nothing.\r
117 \r
118Arguments:\r
119\r
120 ErrorLevel - If error level is set do the debug print.\r
121\r
122 Format - String to use for the print, followed by Print arguments.\r
123\r
124 Marker - VarArgs\r
125 \r
126Returns:\r
127 \r
128 None\r
129\r
130--*/\r
131;\r
132\r
133VOID\r
134EfiDebugPrint (\r
135 IN UINTN ErrorLevel,\r
136 IN CHAR8 *Format,\r
137 ...\r
138 )\r
139/*++\r
140\r
141Routine Description:\r
142\r
143 Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT\r
144 information. If Error Logging hub is not loaded do nothing.\r
145\r
146Arguments:\r
147\r
148 ErrorLevel - If error level is set do the debug print.\r
149\r
150 Format - String to use for the print, followed by Print arguments.\r
151\r
152 ... - VAR args for Format\r
153\r
154Returns:\r
155 \r
156 None\r
157\r
158--*/\r
159;\r
160\r
161EFI_STATUS\r
162EFIAPI\r
163SmmEfiCreateEventLegacyBoot (\r
164 IN EFI_TPL NotifyTpl,\r
165 IN EFI_EVENT_NOTIFY NotifyFunction,\r
166 IN VOID *NotifyContext,\r
167 OUT EFI_EVENT *LegacyBootEvent\r
168 )\r
169/*++\r
170\r
171Routine Description:\r
172 Create a Legacy Boot Event. \r
173 Tiano extended the CreateEvent Type enum to add a legacy boot event type. \r
174 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
175 added and now it's possible to not voilate the UEFI specification by \r
176 declaring a GUID for the legacy boot event class. This library supports\r
8598a1ed 177 the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.\r
3eb9473e 178\r
179Arguments:\r
180 LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)\r
181\r
182Returns:\r
183 EFI_SUCCESS Event was created.\r
184 Other Event was not created.\r
185\r
186--*/\r
187;\r
188\r
189EFI_STATUS\r
190EFIAPI\r
191SmmEfiCreateEventReadyToBoot (\r
192 IN EFI_TPL NotifyTpl,\r
193 IN EFI_EVENT_NOTIFY NotifyFunction,\r
194 IN VOID *NotifyContext,\r
195 OUT EFI_EVENT *ReadyToBootEvent\r
196 )\r
197/*++\r
198\r
199Routine Description:\r
200 Create a Read to Boot Event. \r
201 \r
202 Tiano extended the CreateEvent Type enum to add a ready to boot event type. \r
203 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
204 added and now it's possible to not voilate the UEFI specification and use \r
205 the ready to boot event class defined in UEFI 2.0. This library supports\r
8598a1ed 206 the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.\r
3eb9473e 207\r
208Arguments:\r
209 ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)\r
210\r
211Return:\r
212 EFI_SUCCESS - Event was created.\r
213 Other - Event was not created.\r
214\r
215--*/\r
216;\r
217\r
218#endif\r