-/** @file \r
- Defines library APIs used by modules to save EFI Boot Script Opcodes. \r
- These OpCode will be restored by S3 related modules. \r
- Note that some of the API defined in the Library class may not \r
- be provided in the Framework version library instance, which means some of these \r
+/** @file\r
+ Defines library APIs used by modules to save EFI Boot Script Opcodes.\r
+ These OpCode will be restored by S3 related modules.\r
+ Note that some of the API defined in the Library class may not\r
+ be provided in the Framework version library instance, which means some of these\r
APIs cannot be used if the underlying firmware is Framework and not PI.\r
\r
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
(((UINTN) Device) << 16) | \\r
(((UINTN) Function) << 8) | \\r
(((UINTN) (Register)) < 256 ? ((UINTN) (Register)) : (UINT64) (LShiftU64 ((UINT64) (Register), 32))))\r
- \r
+\r
///\r
/// S3 Boot Script Width.\r
///\r
typedef enum {\r
S3BootScriptWidthUint8, ///< 8-bit operation.\r
S3BootScriptWidthUint16, ///< 16-bit operation.\r
- S3BootScriptWidthUint32, ///< 32-bit operation. \r
+ S3BootScriptWidthUint32, ///< 32-bit operation.\r
S3BootScriptWidthUint64, ///< 64-bit operation.\r
S3BootScriptWidthFifoUint8, ///< 8-bit FIFO operation.\r
S3BootScriptWidthFifoUint16, ///< 16-bit FIFO operation.\r
@param[in] Count The number of I/O operations to perform.\r
@param[in] Buffer The source buffer from which to write data.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
\r
@param[in] DataMask A pointer to the data mask to be AND-ed with the data\r
read from the register.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
\r
@param[in] Count The number of memory operations to perform.\r
@param[in] Buffer The source buffer from which to write the data.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
Adds a record for a memory modify operation into a specified boot script table.\r
\r
@param[in] Width The width of the I/O operations.\r
- @param[in] Address The base address of the memory operations. Address needs \r
+ @param[in] Address The base address of the memory operations. Address needs\r
alignment, if required\r
@param[in] Data A pointer to the data to be OR-ed.\r
- @param[in] DataMask A pointer to the data mask to be AND-ed with the data \r
+ @param[in] DataMask A pointer to the data mask to be AND-ed with the data\r
read from the register.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
@param[in] Count The number of PCI operations to perform.\r
@param[in] Buffer The source buffer from which to write the data.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
@param[in] Data A pointer to the data to be OR-ed.The size depends on Width.\r
@param[in] DataMask A pointer to the data mask to be AND-ed.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN__SUCCESS The opcode was added.\r
**/\r
@param[in] Count The number of PCI operations to perform.\r
@param[in] Buffer The source buffer from which to write the data.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
@param[in] Data A pointer to the data to be OR-ed. The size depends on Width.\r
@param[in] DataMask A pointer to the data mask to be AND-ed.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
/**\r
Adds a record for an SMBus command execution into a specified boot script table.\r
\r
- @param[in] SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS \r
+ @param[in] SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS\r
Command, SMBUS Data Length, and PEC.\r
- @param[in] Operation Indicates which particular SMBus protocol it will use \r
+ @param[in] Operation Indicates which particular SMBus protocol it will use\r
to execute the SMBus transactions.\r
- @param[in] Length A pointer to signify the number of bytes that this \r
+ @param[in] Length A pointer to signify the number of bytes that this\r
operation will do.\r
- @param[in] Buffer Contains the value of data to execute to the SMBUS \r
+ @param[in] Buffer Contains the value of data to execute to the SMBUS\r
slave device.\r
- \r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+\r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
RETURN_STATUS\r
EFIAPI\r
S3BootScriptSaveSmbusExecute (\r
- IN UINTN SmBusAddress, \r
+ IN UINTN SmBusAddress,\r
IN EFI_SMBUS_OPERATION Operation,\r
IN UINTN *Length,\r
IN VOID *Buffer\r
Adds a record for an execution stall on the processor into a specified boot script table.\r
\r
@param[in] Duration The duration in microseconds of the stall.\r
- \r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+\r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
Adds a record for dispatching specified arbitrary code into a specified boot script table.\r
\r
@param[in] EntryPoint The entry point of the code to be dispatched.\r
- @param[in] Context The argument to be passed into the EntryPoint of the code \r
+ @param[in] Context The argument to be passed into the EntryPoint of the code\r
to be dispatched.\r
- \r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+\r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
Adds a record for dispatching specified arbitrary code into a specified boot script table.\r
\r
@param[in] EntryPoint The entry point of the code to be dispatched.\r
- \r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+\r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
**/\r
);\r
\r
/**\r
- Adds a record for memory reads of the memory location and continues when the exit \r
+ Adds a record for memory reads of the memory location and continues when the exit\r
criteria is satisfied, or after a defined duration.\r
\r
Please aware, below interface is different with PI specification, Vol 5:\r
\r
@param[in] Width The width of the memory operations.\r
@param[in] Address The base address of the memory operations.\r
- @param[in] BitMask A pointer to the bit mask to be AND-ed with the data read \r
+ @param[in] BitMask A pointer to the bit mask to be AND-ed with the data read\r
from the register.\r
@param[in] BitValue A pointer to the data value after to be Masked.\r
@param[in] Duration The duration in microseconds of the stall.\r
@param[in] LoopTimes The times of the register polling.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
\r
);\r
\r
/**\r
- Store arbitrary information in the boot script table. This opcode is a no-op on \r
+ Store arbitrary information in the boot script table. This opcode is a no-op on\r
dispatch and is only used for debugging script issues.\r
- \r
+\r
@param[in] InformationLength Length of the data in bytes\r
@param[in] Information Information to be logged in the boot scrpit\r
- \r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+\r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
\r
RETURN_STATUS\r
EFIAPI\r
S3BootScriptSaveInformation (\r
- IN UINT32 InformationLength, \r
+ IN UINT32 InformationLength,\r
IN VOID *Information\r
);\r
/**\r
Adds a record for I/O reads the I/O location and continues when the exit criteria\r
is satisfied, or after a defined duration.\r
- \r
- @param Width The width of the I/O operations. \r
+\r
+ @param Width The width of the I/O operations.\r
@param Address The base address of the I/O operations.\r
@param Data The comparison value used for the polling exit criteria.\r
- @param DataMask The mask used for the polling criteria. The bits in \r
- the bytes below Width which are zero in Data are \r
+ @param DataMask The mask used for the polling criteria. The bits in\r
+ the bytes below Width which are zero in Data are\r
ignored when polling the memory address.\r
- @param Delay The number of 100ns units to poll. Note that timer \r
- available may be of insufficient granularity, so the \r
+ @param Delay The number of 100ns units to poll. Note that timer\r
+ available may be of insufficient granularity, so the\r
delay may be longer.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the\r
operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
- @note The FRAMEWORK version implementation does not support this API \r
+ @note The FRAMEWORK version implementation does not support this API\r
**/\r
RETURN_STATUS\r
EFIAPI\r
IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r
IN UINT64 Address,\r
IN VOID *Data,\r
- IN VOID *DataMask, \r
- IN UINT64 Delay \r
+ IN VOID *DataMask,\r
+ IN UINT64 Delay\r
);\r
\r
/**\r
- Adds a record for PCI configuration space reads and continues when the exit \r
+ Adds a record for PCI configuration space reads and continues when the exit\r
criteria is satisfied ,or after a defined duration.\r
\r
- @param Width The width of the I/O operations. \r
+ @param Width The width of the I/O operations.\r
@param Address The address within the PCI configuration space.\r
- @param Data The comparison value used for the polling exit \r
+ @param Data The comparison value used for the polling exit\r
criteria.\r
- @param DataMask Mask used for the polling criteria. The bits in \r
+ @param DataMask Mask used for the polling criteria. The bits in\r
the bytes below Width which are zero in Data are\r
ignored when polling the memory address.\r
- @param Delay The number of 100ns units to poll. Note that timer \r
- available may be of insufficient granularity, so the \r
+ @param Delay The number of 100ns units to poll. Note that timer\r
+ available may be of insufficient granularity, so the\r
delay may be longer.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the\r
operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
- @note The FRAMEWORK version implementation does not support this API \r
+ @note The FRAMEWORK version implementation does not support this API\r
**/\r
RETURN_STATUS\r
EFIAPI\r
IN UINT64 Delay\r
);\r
/**\r
- Adds a record for PCI configuration space reads and continues when the exit criteria \r
+ Adds a record for PCI configuration space reads and continues when the exit criteria\r
is satisfied, or after a defined duration.\r
\r
- @param Width The width of the I/O operations. \r
+ @param Width The width of the I/O operations.\r
@param Segment The PCI segment number for Address.\r
@param Address The address within the PCI configuration space.\r
- @param Data The comparison value used for the polling exit \r
+ @param Data The comparison value used for the polling exit\r
criteria.\r
- @param DataMask Mask used for the polling criteria. The bits in \r
+ @param DataMask Mask used for the polling criteria. The bits in\r
the bytes below Width which are zero\r
in Data are ignored when polling the memory address\r
- @param Delay The number of 100ns units to poll. Note that timer \r
- available may be of insufficient granularity so the delay \r
+ @param Delay The number of 100ns units to poll. Note that timer\r
+ available may be of insufficient granularity so the delay\r
may be longer.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the\r
operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
- @note A known Limitations in the implementation: When interpreting the opcode \r
+ @note A known Limitations in the implementation: When interpreting the opcode\r
EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE, EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE\r
- and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as \r
+ and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as\r
Zero, or else, assert.\r
The FRAMEWORK version implementation does not support this API.\r
\r
IN UINT64 Delay\r
);\r
/**\r
- Save ASCII string information specified by Buffer to boot script with opcode \r
+ Save ASCII string information specified by Buffer to boot script with opcode\r
EFI_BOOT_SCRIPT_INFORMATION_OPCODE.\r
\r
- @param[in] String The Null-terminated ASCII string to store into the S3 boot \r
+ @param[in] String The Null-terminated ASCII string to store into the S3 boot\r
script table.\r
\r
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform \r
+ @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r
the operation.\r
@retval RETURN_SUCCESS The opcode was added.\r
\r
);\r
\r
/**\r
- This is an function to close the S3 boot script table. The function could only \r
- be called in BOOT time phase. To comply with the Framework spec definition on \r
+ This is an function to close the S3 boot script table. The function could only\r
+ be called in BOOT time phase. To comply with the Framework spec definition on\r
EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things:\r
1. Closes the specified boot script table\r
- 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table. \r
- Once this function is called, the table maintained by the library will be destroyed \r
+ 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table.\r
+ Once this function is called, the table maintained by the library will be destroyed\r
after it is copied into the allocated pool.\r
- 3. Any attempts to add a script record after calling this function will cause a \r
+ 3. Any attempts to add a script record after calling this function will cause a\r
new table to be created by the library.\r
- 4. The base address of the allocated pool will be returned in Address. Note that \r
- after using the boot script table, the CALLER is responsible for freeing the \r
- pool that is allocated by this function. \r
+ 4. The base address of the allocated pool will be returned in Address. Note that\r
+ after using the boot script table, the CALLER is responsible for freeing the\r
+ pool that is allocated by this function.\r
\r
- In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. This \r
+ In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. This\r
API is supplied here to meet the requirements of the Framework Spec.\r
- \r
+\r
If anyone does call CloseTable() on a real platform, then the caller is responsible\r
- for figuring out how to get the script to run on an S3 resume because the boot script \r
+ for figuring out how to get the script to run on an S3 resume because the boot script\r
maintained by the lib will be destroyed.\r
- \r
- @return the base address of the new copy of the boot script table. \r
+\r
+ @return the base address of the new copy of the boot script table.\r
\r
**/\r
UINT8*\r
Executes the S3 boot script table.\r
\r
@retval RETURN_SUCCESS The boot script table was executed successfully.\r
- @retval RETURN_UNSUPPORTED Invalid script table or opcode. \r
+ @retval RETURN_UNSUPPORTED Invalid script table or opcode.\r
\r
**/\r
RETURN_STATUS\r
VOID\r
);\r
/**\r
- Move the last boot script entry to the position \r
+ Move the last boot script entry to the position\r
\r
- @param BeforeOrAfter Specifies whether the opcode is stored before \r
- (TRUE) or after (FALSE) the positionin the boot \r
- script table specified by Position. If Position \r
- is NULL or points to NULL then the new opcode is \r
- inserted at the beginning of the table (if TRUE) \r
+ @param BeforeOrAfter Specifies whether the opcode is stored before\r
+ (TRUE) or after (FALSE) the positionin the boot\r
+ script table specified by Position. If Position\r
+ is NULL or points to NULL then the new opcode is\r
+ inserted at the beginning of the table (if TRUE)\r
or end of the table (if FALSE).\r
- @param Position On entry, specifies the position in the boot script \r
- table where the opcode will be inserted, either \r
- before or after, depending on BeforeOrAfter. On \r
- exit, specifies the position of the inserted opcode \r
+ @param Position On entry, specifies the position in the boot script\r
+ table where the opcode will be inserted, either\r
+ before or after, depending on BeforeOrAfter. On\r
+ exit, specifies the position of the inserted opcode\r
in the boot script table.\r
\r
@retval RETURN_OUT_OF_RESOURCES The table is not available.\r
- @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the \r
+ @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the\r
boot script table.\r
@retval RETURN_SUCCESS The opcode was inserted.\r
- @note The FRAMEWORK version implementation does not support this API. \r
+ @note The FRAMEWORK version implementation does not support this API.\r
**/\r
RETURN_STATUS\r
EFIAPI\r
Find a label within the boot script table and, if not present, optionally create it.\r
\r
@param BeforeOrAfter Specifies whether the opcode is stored before (TRUE)\r
- or after (FALSE) the position in the boot script table \r
+ or after (FALSE) the position in the boot script table\r
specified by Position.\r
- @param CreateIfNotFound Specifies whether the label will be created if the \r
+ @param CreateIfNotFound Specifies whether the label will be created if the\r
label does not exists (TRUE) or not (FALSE).\r
- @param Position On entry, specifies the position in the boot script \r
- table where the opcode will be inserted, either \r
- before or after, depending on BeforeOrAfter. On exit, \r
- specifies the positionof the inserted opcode in \r
+ @param Position On entry, specifies the position in the boot script\r
+ table where the opcode will be inserted, either\r
+ before or after, depending on BeforeOrAfter. On exit,\r
+ specifies the positionof the inserted opcode in\r
the boot script table.\r
- @param Label Points to the label which will be inserted in the \r
+ @param Label Points to the label which will be inserted in the\r
boot script table.\r
- @retval EFI_SUCCESS The operation succeeded. A record was added into \r
+ @retval EFI_SUCCESS The operation succeeded. A record was added into\r
the specified script table.\r
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script \r
- is not supported. If the opcode is unknow or not \r
+ @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script\r
+ is not supported. If the opcode is unknow or not\r
supported because of the PCD Feature Flags.\r
@retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r
- @note The FRAMEWORK version implementation does not support this API \r
+ @note The FRAMEWORK version implementation does not support this API\r
\r
**/\r
RETURN_STATUS\r
-EFIAPI \r
+EFIAPI\r
S3BootScriptLabel (\r
IN BOOLEAN BeforeOrAfter,\r
IN BOOLEAN CreateIfNotFound,\r
\r
@retval EFI_SUCCESS The operation succeeded. A record was added into the\r
specified script table.\r
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script \r
+ @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script\r
is not supported. If the opcode is unknow or not s\r
upported because of the PCD Feature Flags.\r
@retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r
- @note The FRAMEWORK version implementation does not support this API \r
+ @note The FRAMEWORK version implementation does not support this API\r
**/\r
RETURN_STATUS\r
-EFIAPI \r
+EFIAPI\r
S3BootScriptCompare (\r
IN UINT8 *Position1,\r
IN UINT8 *Position2,\r