3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Light weight lib to support EFI Smm drivers.
22 #ifndef _EFI_SMM_DRIVER_LIB_H_
23 #define _EFI_SMM_DRIVER_LIB_H_
27 #include "EfiCommonLib.h"
28 #include EFI_GUID_DEFINITION (EventLegacyBios)
29 #include EFI_GUID_DEFINITION (EventGroup)
30 #include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
31 #include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
32 #include EFI_PROTOCOL_DEFINITION (SmmBase)
33 #include EFI_PROTOCOL_DEFINITION (SmmStatusCode)
35 // Driver Lib Globals.
37 extern EFI_BOOT_SERVICES
*gBS
;
38 extern EFI_SYSTEM_TABLE
*gST
;
39 extern EFI_RUNTIME_SERVICES
*gRT
;
40 extern EFI_SMM_BASE_PROTOCOL
*gSMM
;
41 extern EFI_SMM_STATUS_CODE_PROTOCOL
*mSmmDebug
;
42 extern UINTN gErrorLevel
;
44 #define EfiCopyMem EfiCommonLibCopyMem
45 #define EfiSetMem EfiCommonLibSetMem
46 #define EfiZeroMem EfiCommonLibZeroMem
49 EfiInitializeSmmDriverLib (
50 IN EFI_HANDLE ImageHandle
,
51 IN EFI_SYSTEM_TABLE
*SystemTable
,
58 Intialize Smm Driver Lib if it has not yet been initialized.
62 ImageHandle - The firmware allocated handle for the EFI image.
64 SystemTable - A pointer to the EFI System Table.
66 InSmm - If InSmm is NULL, it will not register Image to SMM.
67 If InSmm is not NULL, it will register Image to SMM and
68 return information on currently in SMM mode or not.
72 EFI_STATUS always returns EFI_SUCCESS
87 Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT
88 information. If Error Logging hub is not loaded DEADLOOP ().
92 FileName - File name of failing routine.
94 LineNumber - Line number of failing ASSERT().
96 Description - Description, usually the assertion,
115 Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
116 information. If Error Logging hub is not loaded do nothing.
120 ErrorLevel - If error level is set do the debug print.
122 Format - String to use for the print, followed by Print arguments.
143 Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
144 information. If Error Logging hub is not loaded do nothing.
148 ErrorLevel - If error level is set do the debug print.
150 Format - String to use for the print, followed by Print arguments.
152 ... - VAR args for Format
163 SmmEfiCreateEventLegacyBoot (
164 IN EFI_TPL NotifyTpl
,
165 IN EFI_EVENT_NOTIFY NotifyFunction
,
166 IN VOID
*NotifyContext
,
167 OUT EFI_EVENT
*LegacyBootEvent
172 Create a Legacy Boot Event.
173 Tiano extended the CreateEvent Type enum to add a legacy boot event type.
174 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
175 added and now it's possible to not voilate the UEFI specification by
176 declaring a GUID for the legacy boot event class. This library supports
177 the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to
181 LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
184 EFI_SUCCESS Event was created.
185 Other Event was not created.
192 SmmEfiCreateEventReadyToBoot (
193 IN EFI_TPL NotifyTpl
,
194 IN EFI_EVENT_NOTIFY NotifyFunction
,
195 IN VOID
*NotifyContext
,
196 OUT EFI_EVENT
*ReadyToBootEvent
201 Create a Read to Boot Event.
203 Tiano extended the CreateEvent Type enum to add a ready to boot event type.
204 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
205 added and now it's possible to not voilate the UEFI specification and use
206 the ready to boot event class defined in UEFI 2.0. This library supports
207 the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to
211 ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
214 EFI_SUCCESS - Event was created.
215 Other - Event was not created.