/** @file\r
- Null function implementation for EFI S3 boot script. \r
+ Null function implementation for EFI S3 boot script.\r
\r
- Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 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
#include <Library/S3BootScriptLib.h>\r
\r
/**\r
- Save I/O write to boot script \r
+ Save I/O write to boot script\r
\r
@param Width the width of the I/O operations.Enumerated in S3_BOOT_SCRIPT_LIB_WIDTH.\r
@param Address The base address of the I/O operations.\r
IN VOID *Buffer\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
\r
/**\r
IN VOID *DataMask\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
\r
/**\r
IN VOID *Buffer\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for a memory modify operation into a specified boot script table.\r
IN VOID *DataMask\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for a PCI configuration space write operation into a specified boot script table.\r
IN VOID *Buffer\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
\r
/**\r
IN VOID *DataMask\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for a PCI configuration space modify operation into a specified boot script table.\r
IN VOID *Buffer\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for a PCI configuration space modify operation into a specified boot script table.\r
IN VOID *Data,\r
IN VOID *DataMask\r
)\r
-{ \r
- return RETURN_SUCCESS;\r
+{\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for an SMBus command execution into a specified boot script table.\r
transactions.\r
@param Length A pointer to signify the number of bytes that this operation will do.\r
@param Buffer Contains the value of data to execute to the SMBUS slave device.\r
- \r
+\r
@retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation.\r
@retval RETURN_SUCCESS Opcode is 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
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for an execution stall on the processor into a specified boot script table.\r
\r
@param Duration Duration in microseconds of the stall\r
- \r
+\r
@retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation.\r
@retval RETURN_SUCCESS Opcode is added.\r
**/\r
IN UINTN Duration\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for dispatching specified arbitrary code into a specified boot script table.\r
\r
@param EntryPoint Entry point of the code to be dispatched.\r
- \r
+\r
@retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation.\r
@retval RETURN_SUCCESS Opcode is added.\r
**/\r
\r
@param EntryPoint Entry point of the code to be dispatched.\r
@param Context Argument to be passed into the EntryPoint of the code to be dispatched.\r
- \r
+\r
@retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation.\r
@retval RETURN_SUCCESS Opcode is added.\r
**/\r
IN VOID *Context\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
\r
/**\r
Adds a record for memory reads of the memory location and continues when the exit criteria is\r
satisfied or after a defined duration.\r
- \r
+\r
+ Please aware, below interface is different with PI specification, Vol 5:\r
+ EFI_S3_SAVE_STATE_PROTOCOL.Write() for EFI_BOOT_SCRIPT_MEM_POLL_OPCODE.\r
+ "Duration" below is microseconds, while "Delay" in PI specification means\r
+ the number of 100ns units to poll.\r
+\r
@param Width The width of the memory operations.\r
@param Address The base address of the memory operations.\r
@param BitMask A pointer to the bit mask to be AND-ed with the data read from the register.\r
IN VOID *BitMask,\r
IN VOID *BitValue,\r
IN UINTN Duration,\r
- IN UINTN LoopTimes\r
+ IN UINT64 LoopTimes\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
\r
/**\r
Store arbitrary information in the boot script table. This opcode is a no-op on dispatch and is only\r
used for debugging script issues.\r
- \r
+\r
@param InformationLength Length of the data in bytes\r
@param Information Information to be logged in the boot scrpit\r
- \r
+\r
@retval RETURN_UNSUPPORTED If entering runtime, this method will not support.\r
@retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation.\r
@retval RETURN_SUCCESS Opcode is added.\r
RETURN_STATUS\r
EFIAPI\r
S3BootScriptSaveInformation (\r
- IN UINT32 InformationLength, \r
+ IN UINT32 InformationLength,\r
IN VOID *Information\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for I/O reads the I/O location and continues when the exit criteria is satisfied or after a\r
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 Mask used for the polling criteria. The bits in the bytes below Width which are zero\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
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
\r
/**\r
Adds a record for PCI configuration space reads and continues when the exit criteria is satisfied or\r
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 criteria.\r
@param DataMask Mask used for the polling criteria. The bits in the bytes below Width which are zero\r
IN UINT64 Delay\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Adds a record for PCI configuration space reads and continues when the exit criteria is satisfied or\r
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 criteria.\r
@retval RETURN_OUT_OF_RESOURCES Not enough memory for the table do operation.\r
@retval RETURN_SUCCESS Opcode is added.\r
@note A known Limitations in the implementation: When interpreting the opcode EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE\r
- EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as \r
+ EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as\r
Zero, or else, assert.\r
\r
**/\r
IN UINT64 Delay\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Save ASCII string information specified by Buffer to\r
IN CONST CHAR8 *String\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
- This is an function to close the S3 boot script table. The function could only be called in \r
- 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 be called in\r
+ 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 new table \r
+ 3. Any attempts to add a script record after calling this function will cause a new table\r
to be created by the library.\r
- 4. The base address of the allocated pool will be returned in Address. Note that after \r
+ 4. The base address of the allocated pool will be returned in Address. Note that after\r
using the boot script table, the CALLER is responsible for freeing the pool that is allocated\r
- by this function. \r
+ by this function.\r
\r
In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. By then it is not\r
necessary to provide this API in BootScriptLib. To provides this API for now is only to meet\r
the requirement from Framework Spec.\r
- \r
- If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out \r
- how to get the script to run on an S3 resume because the boot script maintained by the lib will be \r
+\r
+ If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out\r
+ how to get the script to run on an S3 resume because the boot script maintained by the lib will be\r
destroyed.\r
- \r
- @return the base address of the new copy of the boot script tble. \r
+\r
+ @return the base address of the new copy of the boot script table.\r
\r
**/\r
UINT8*\r
VOID\r
)\r
{\r
- return 0;\r
+ return 0;\r
}\r
/**\r
Executes the S3 boot script table.\r
\r
@param RETURN_SUCCESS The boot script table was executed successfully.\r
- @param RETURN_UNSUPPORTED Invalid script table or opcode. \r
+ @param RETURN_UNSUPPORTED Invalid script table or opcode.\r
**/\r
RETURN_STATUS\r
EFIAPI\r
VOID\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\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 (TRUE) or after (FALSE) the position\r
in the boot script table specified by Position. If Position is NULL or points to\r
IN OUT VOID **Position OPTIONAL\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\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 label \r
+ @param CreateIfNotFound Specifies whether the label will be created if the label\r
does not exists (TRUE) or not (FALSE).\r
@param Position On entry, specifies the position in the boot script table\r
where the opcode will be inserted, either before or after,\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 is not supported.\r
- If the opcode is unknow or not supported because of the PCD \r
+ If the opcode is unknow or not supported because of the PCD\r
Feature Flags.\r
@retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r
\r
**/\r
RETURN_STATUS\r
-EFIAPI \r
+EFIAPI\r
S3BootScriptLabel (\r
IN BOOLEAN BeforeOrAfter,\r
IN BOOLEAN CreateIfNotFound,\r
IN CONST CHAR8 *Label\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r
/**\r
Compare two positions in the boot script table and return their relative position.\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 is not supported.\r
- If the opcode is unknow or not supported because of the PCD \r
+ If the opcode is unknow or not supported because of the PCD\r
Feature Flags.\r
@retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r
\r
**/\r
RETURN_STATUS\r
-EFIAPI \r
+EFIAPI\r
S3BootScriptCompare (\r
IN UINT8 *Position1,\r
IN UINT8 *Position2,\r
OUT UINTN *RelativePosition\r
)\r
{\r
- return RETURN_SUCCESS;\r
+ return RETURN_SUCCESS;\r
}\r