--- /dev/null
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+Module Name:\r
+ \r
+ EfiScriptLib.h\r
+\r
+Abstract:\r
+\r
+ \r
+--*/\r
+\r
+#ifndef _BOOT_SCRIPT_LIB_H_\r
+#define _BOOT_SCRIPT_LIB_H_\r
+\r
+#include <PiPei.h>\r
+#include <Ppi/BootScriptExecuter.h>\r
+\r
+#include <IndustryStandard/SmBus.h>\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveIoWrite (\r
+ IN UINT16 TableName,\r
+ IN EFI_BOOT_SCRIPT_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN VOID *Buffer\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ Width - The width of the I/O operations.\r
+ \r
+ Address - The base address of the I/O operations.\r
+ \r
+ Count - The number of I/O operations to perform.\r
+ \r
+ Buffer - The source buffer from which to write data. \r
+\r
+Returns: \r
+ \r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveIoReadWrite (\r
+ IN UINT16 TableName,\r
+ IN EFI_BOOT_SCRIPT_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN VOID *Data,\r
+ IN VOID *DataMask\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ Width - The width of the I/O operations.\r
+ \r
+ Address - The base address of the I/O operations.\r
+ \r
+ Data - A pointer to the data to be OR-ed.\r
+ \r
+ DataMask - A pointer to the data mask to be AND-ed with the data read from the register.\r
+\r
+Returns: \r
+ \r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveMemWrite (\r
+ IN UINT16 TableName,\r
+ IN EFI_BOOT_SCRIPT_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN VOID *Buffer\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ Width - The width of the memory operations.\r
+ \r
+ Address - The base address of the memory operations.\r
+ \r
+ Count - The number of memory operations to perform.\r
+ \r
+ Buffer - The source buffer from which to write the data. \r
+\r
+Returns: \r
+ \r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveMemReadWrite (\r
+ IN UINT16 TableName,\r
+ IN EFI_BOOT_SCRIPT_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN VOID *Data,\r
+ IN VOID *DataMask\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ Width - The width of the memory operations.\r
+ \r
+ Address - The base address of the memory operations.\r
+ \r
+ Data - A pointer to the data to be OR-ed.\r
+ \r
+ DataMask - A pointer to the data mask to be AND-ed with the data read from the register.\r
+\r
+Returns: \r
+ \r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSavePciCfgWrite (\r
+ IN UINT16 TableName,\r
+ IN EFI_BOOT_SCRIPT_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN VOID *Buffer\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save PCI configuration space write operation to boot script with opcode \r
+ EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ Width - The width of the PCI operations\r
+ \r
+ Address - The address within the PCI configuration space.\r
+ \r
+ Count - The number of PCI operations to perform.\r
+ \r
+ Buffer - The source buffer from which to write the data.\r
+\r
+Returns: \r
+ \r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSavePciCfgReadWrite (\r
+ IN UINT16 TableName,\r
+ IN EFI_BOOT_SCRIPT_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN VOID *Data,\r
+ IN VOID *DataMask\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save PCI configuration space modify operation to boot script with opcode \r
+ EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ Width - The width of the PCI operations\r
+ \r
+ Address - The address within the PCI configuration space.\r
+ \r
+ Data - A pointer to the data to be OR-ed.\r
+ \r
+ DataMask - A pointer to the data mask to be AND-ed with the data read from the register.\r
+\r
+Returns: \r
+ \r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveSmbusExecute (\r
+ IN UINT16 TableName,\r
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
+ IN EFI_SMBUS_DEVICE_COMMAND Command,\r
+ IN EFI_SMBUS_OPERATION Operation,\r
+ IN BOOLEAN PecCheck,\r
+ IN UINTN *Length,\r
+ IN VOID *Buffer\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save SMBus command execution to boot script with opcode \r
+ EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+ SlaveAddress - The SMBus address for the slave device that the operation is targeting.\r
+ Command - The command that is transmitted by the SMBus host controller to the \r
+ SMBus slave device.\r
+ Operation - Indicates which particular SMBus protocol it will use to execute the \r
+ SMBus transactions.\r
+ PecCheck - Defines if Packet Error Code (PEC) checking is required for this operation.\r
+ Length - A pointer to signify the number of bytes that this operation will do.\r
+ Buffer - Contains the value of data to execute to the SMBUS slave device.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveStall (\r
+ IN UINT16 TableName,\r
+ IN UINTN Duration\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save execution stall on the processor to boot script with opcode \r
+ EFI_BOOT_SCRIPT_STALL_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+ \r
+ Duration - Duration in microseconds of the stall.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveDispatch (\r
+ IN UINT16 TableName,\r
+ IN EFI_PHYSICAL_ADDRESS EntryPoint\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save dispatching specified arbitrary code to boot script with opcode \r
+ EFI_BOOT_SCRIPT_DISPATCH_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+ \r
+ EntryPoint - Entry point of the code to be dispatched.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveDispatch2 (\r
+ IN UINT16 TableName,\r
+ IN EFI_PHYSICAL_ADDRESS EntryPoint,\r
+ IN EFI_PHYSICAL_ADDRESS Context\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save dispatching specified arbitrary code to boot script with opcode \r
+ EFI_BOOT_SCRIPT_DISPATCH_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+ \r
+ EntryPoint - Entry point of the code to be dispatched.\r
+\r
+ Context - The data that will be passed into code.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveDispatch2Image (\r
+ IN UINT16 TableName,\r
+ IN EFI_GUID *FfsName,\r
+ IN EFI_PHYSICAL_ADDRESS Context,\r
+ IN EFI_HANDLE ParentHandle\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Save dispatching specified arbitrary code to boot script with opcode \r
+ EFI_BOOT_SCRIPT_DISPATCH_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ FfsName - The file name of the code to be dispatched.\r
+\r
+ Context - The data that will be passed into code.\r
+\r
+ ParentHandle - The caller's image handle.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveInformation (\r
+ IN UINT16 TableName,\r
+ IN UINT32 Length, \r
+ IN EFI_PHYSICAL_ADDRESS Buffer\r
+ )\r
+ /*++\r
+\r
+Routine Description:\r
+\r
+ Save information specified by Buffer, length is specified by Length, to \r
+ boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ FfsName - The file name of the code to be dispatched.\r
+\r
+ Context - The data that will be passed into code.\r
+\r
+ ParentHandle - The caller's image handle.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveInformationUnicodeString (\r
+ IN UINT16 TableName,\r
+ IN CONST CHAR16 *String\r
+ )\r
+ /*++\r
+\r
+Routine Description:\r
+\r
+ Save unicode string information specified by Buffer to \r
+ boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ FfsName - The file name of the code to be dispatched.\r
+\r
+ Context - The data that will be passed into code.\r
+\r
+ ParentHandle - The caller's image handle.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveInformationAsciiString (\r
+ IN UINT16 TableName,\r
+ IN CONST CHAR8 *String\r
+ )\r
+ /*++\r
+\r
+Routine Description:\r
+\r
+ Save ASCII string information specified by Buffer to \r
+ boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE\r
+\r
+Arguments:\r
+\r
+ TableName - Desired boot script table\r
+\r
+ FfsName - The file name of the code to be dispatched.\r
+\r
+ Context - The data that will be passed into code.\r
+\r
+ ParentHandle - The caller's image handle.\r
+\r
+Returns:\r
+\r
+ EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r
+ \r
+ EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+BootScriptSaveInitialize (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+ Intialize Boot Script 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
+Returns: \r
+\r
+ EFI_STATUS always returns EFI_SUCCESS\r
+\r
+--*/\r
+; \r
+#endif\r
+\r
+\r