+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- EfiSmmDriverLib.h\r
-\r
-Abstract:\r
-\r
- Light weight lib to support EFI Smm drivers.\r
-\r
---*/\r
-\r
-#ifndef _EFI_SMM_DRIVER_LIB_H_\r
-#define _EFI_SMM_DRIVER_LIB_H_\r
-\r
-#include "Tiano.h"\r
-#include "GetImage.h"\r
-#include "EfiCommonLib.h"\r
-#include EFI_GUID_DEFINITION (EventLegacyBios)\r
-#include EFI_GUID_DEFINITION (EventGroup)\r
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)\r
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)\r
-#include EFI_PROTOCOL_DEFINITION (SmmBase)\r
-#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)\r
-//\r
-// Driver Lib Globals.\r
-//\r
-extern EFI_BOOT_SERVICES *gBS;\r
-extern EFI_SYSTEM_TABLE *gST;\r
-extern EFI_RUNTIME_SERVICES *gRT;\r
-extern EFI_SMM_BASE_PROTOCOL *gSMM;\r
-extern EFI_SMM_STATUS_CODE_PROTOCOL *mSmmDebug;\r
-extern UINTN gErrorLevel;\r
-\r
-#define EfiCopyMem EfiCommonLibCopyMem\r
-#define EfiSetMem EfiCommonLibSetMem\r
-#define EfiZeroMem EfiCommonLibZeroMem\r
-\r
-EFI_STATUS\r
-EfiInitializeSmmDriverLib (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable,\r
- IN OUT BOOLEAN *InSmm\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Intialize Smm Driver Lib if it has not yet been initialized. \r
-\r
-Arguments:\r
-\r
- ImageHandle - The firmware allocated handle for the EFI image.\r
- \r
- SystemTable - A pointer to the EFI System Table.\r
- \r
- InSmm - If InSmm is NULL, it will not register Image to SMM.\r
- If InSmm is not NULL, it will register Image to SMM and\r
- return information on currently in SMM mode or not.\r
-\r
-Returns: \r
-\r
- EFI_STATUS always returns EFI_SUCCESS\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiDebugAssert (\r
- IN CHAR8 *FileName,\r
- IN INTN LineNumber,\r
- IN CHAR8 *Description\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT\r
- information. If Error Logging hub is not loaded DEADLOOP ().\r
- \r
-Arguments:\r
-\r
- FileName - File name of failing routine.\r
-\r
- LineNumber - Line number of failing ASSERT().\r
-\r
- Description - Description, usually the assertion,\r
- \r
-Returns:\r
- \r
- None\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiDebugVPrint (\r
- IN UINTN ErrorLevel,\r
- IN CHAR8 *Format,\r
- IN VA_LIST Marker\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT\r
- information. If Error Logging hub is not loaded do nothing.\r
- \r
-Arguments:\r
-\r
- ErrorLevel - If error level is set do the debug print.\r
-\r
- Format - String to use for the print, followed by Print arguments.\r
-\r
- Marker - VarArgs\r
- \r
-Returns:\r
- \r
- None\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiDebugPrint (\r
- IN UINTN ErrorLevel,\r
- IN CHAR8 *Format,\r
- ...\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT\r
- information. If Error Logging hub is not loaded do nothing.\r
-\r
-Arguments:\r
-\r
- ErrorLevel - If error level is set do the debug print.\r
-\r
- Format - String to use for the print, followed by Print arguments.\r
-\r
- ... - VAR args for Format\r
-\r
-Returns:\r
- \r
- None\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SmmEfiCreateEventLegacyBoot (\r
- IN EFI_TPL NotifyTpl,\r
- IN EFI_EVENT_NOTIFY NotifyFunction,\r
- IN VOID *NotifyContext,\r
- OUT EFI_EVENT *LegacyBootEvent\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Create a Legacy Boot Event. \r
- Tiano extended the CreateEvent Type enum to add a legacy boot event type. \r
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
- added and now it's possible to not voilate the UEFI specification by \r
- declaring a GUID for the legacy boot event class. This library supports\r
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.\r
-\r
-Arguments:\r
- LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)\r
-\r
-Returns:\r
- EFI_SUCCESS Event was created.\r
- Other Event was not created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SmmEfiCreateEventReadyToBoot (\r
- IN EFI_TPL NotifyTpl,\r
- IN EFI_EVENT_NOTIFY NotifyFunction,\r
- IN VOID *NotifyContext,\r
- OUT EFI_EVENT *ReadyToBootEvent\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Create a Read to Boot Event. \r
- \r
- Tiano extended the CreateEvent Type enum to add a ready to boot event type. \r
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
- added and now it's possible to not voilate the UEFI specification and use \r
- the ready to boot event class defined in UEFI 2.0. This library supports\r
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.\r
-\r
-Arguments:\r
- ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)\r
-\r
-Return:\r
- EFI_SUCCESS - Event was created.\r
- Other - Event was not created.\r
-\r
---*/\r
-;\r
-\r
-#endif\r