]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiSmmDriverLib.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / EfiSmmDriverLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
4ea9375a
HT
3Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
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
177 the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to \r
178 work both ways.\r
179\r
180Arguments:\r
181 LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)\r
182\r
183Returns:\r
184 EFI_SUCCESS Event was created.\r
185 Other Event was not created.\r
186\r
187--*/\r
188;\r
189\r
190EFI_STATUS\r
191EFIAPI\r
192SmmEfiCreateEventReadyToBoot (\r
193 IN EFI_TPL NotifyTpl,\r
194 IN EFI_EVENT_NOTIFY NotifyFunction,\r
195 IN VOID *NotifyContext,\r
196 OUT EFI_EVENT *ReadyToBootEvent\r
197 )\r
198/*++\r
199\r
200Routine Description:\r
201 Create a Read to Boot Event. \r
202 \r
203 Tiano extended the CreateEvent Type enum to add a ready to boot event type. \r
204 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
205 added and now it's possible to not voilate the UEFI specification and use \r
206 the ready to boot event class defined in UEFI 2.0. This library supports\r
207 the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to \r
208 work both ways.\r
209\r
210Arguments:\r
211 ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)\r
212\r
213Return:\r
214 EFI_SUCCESS - Event was created.\r
215 Other - Event was not created.\r
216\r
217--*/\r
218;\r
219\r
220#endif\r