TianoCore EDK2 master
|
#include "InternalBootScriptLib.h"
Go to the source code of this file.
Interpret and execute the S3 data in S3 boot script.
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteDispatch | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_DISPATCH OP code.
Script | The pointer of typed node in boot script table |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1106 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteDispatch2 | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_DISPATCH_2 OP code.
Script | The pointer of typed node in boot script table |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1131 of file BootScriptExecute.c.
VOID BootScriptExecuteInformation | ( | IN UINT8 * | Script | ) |
Execute the boot script to interpret the Store arbitrary information. This opcode is a no-op on dispatch and is only used for debugging script issues.
Script | The pointer of node in boot script table |
Definition at line 1218 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteIoPoll | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_IO_POLL OP code.
Script | The pointer of typed node in boot script table |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_DEVICE_ERROR | Data polled from memory does not equal to the epecting data within the Loop Times. |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1366 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteIoReadWrite | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_IO_READ_WRITE OP code.
Script | The pointer of typed node in boot script table |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 914 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteIoWrite | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_IO_WRITE OP code.
Script | Pointer to the node which is to be interpreted. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. Address is outside the legal range of I/O ports. |
Definition at line 385 of file BootScriptExecute.c.
VOID BootScriptExecuteLabel | ( | IN UINT8 * | Script | ) |
Execute the boot script to interpret the Label information.
Script | The pointer of node in boot script table |
Definition at line 1247 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteMemoryReadWrite | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_MEM_READ_WRITE OP code.
Script | The pointer of typed node in boot script table |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 960 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteMemoryWrite | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_MEM_WRITE OP code.
[in] | Script | Pointer to the node which is to be interpreted. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. |
EFI_UNSUPPORTED | The address range specified by Address, Width, and Count is not valid for this EFI System. |
Definition at line 621 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteMemPoll | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_MEM_POLL OP code.
Script | The pointer of typed node in boot script table |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_DEVICE_ERROR | Data polled from memory does not equal to the epecting data within the Loop Times. |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1162 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecutePciCfg2ReadWrite | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE OP code.
Script | The pointer of S3 boot script |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1456 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecutePciCfg2Write | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE OP code.
Script | The pointer of S3 boot script |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1422 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecutePciCfgReadWrite | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_PCI_CFG_READ_WRITE OP code.
Script | The pointer of typed node in boot script table |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1006 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecutePciCfgWrite | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE OP code.
Script | The pointer of typed node in boot script table |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 883 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteSmbusExecute | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_SMBUS_EXECUTE OP code.
Script | The pointer of typed node in boot script table |
EFI_SUCCESS | The operation was executed successfully |
EFI_UNSUPPORTED | Cannot locate smbus ppi or occur error of script execution |
Others | Result of script execution |
Definition at line 1055 of file BootScriptExecute.c.
EFI_STATUS BootScriptExecuteStall | ( | IN UINT8 * | Script | ) |
Interpret the boot script node with EFI_BOOT_SCRIPT_STALL OP code.
Script | The pointer of typed node in boot script table |
EFI_SUCCESS | The operation was executed successfully |
Definition at line 1085 of file BootScriptExecute.c.
EFI_STATUS BootScriptPciCfg2Poll | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL OP code.
Script | The pointer of S3 Boot Script |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_SUCCESS | The operation was executed successfully |
EFI_DEVICE_ERROR | Data polled from Pci configuration space does not equal to epecting data within the Loop Times. |
Definition at line 1568 of file BootScriptExecute.c.
EFI_STATUS BootScriptPciCfgPoll | ( | IN UINT8 * | Script, |
IN UINT64 | AndMask, | ||
IN UINT64 | OrMask | ||
) |
Interpret the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_POLL OP code.
Script | The pointer of S3 boot script |
AndMask | Mask value for 'and' operation |
OrMask | Mask value for 'or' operation |
EFI_SUCCESS | The operation was executed successfully |
EFI_DEVICE_ERROR | Data polled from Pci configuration space does not equal to epecting data within the Loop Times. |
Definition at line 1506 of file BootScriptExecute.c.
EFI_STATUS BuildLoopData | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
OUT UINTN * | AddressStride, | ||
OUT UINTN * | BufferStride | ||
) |
Translates boot script width and address stride to MDE library interface.
Width | Width of the operation. |
Address | Address of the operation. |
AddressStride | Instride for stepping input buffer. |
BufferStride | Outstride for stepping output buffer. |
EFI_SUCCESS | Successful translation. |
EFI_INVALID_PARAMETER | Width or Address is invalid. |
Definition at line 132 of file BootScriptExecute.c.
VOID CheckAndOrMask | ( | IN EFI_BOOT_SCRIPT_COMMON_HEADER * | ScriptHeader, |
OUT UINT64 * | AndMask, | ||
OUT UINT64 * | OrMask, | ||
IN UINT8 * | Script | ||
) |
calculate the mask value for 'and' and 'or' operation
ScriptHeader | The pointer of header of node in boot script table |
AndMask | The Mask value for 'and' operation |
OrMask | The Mask value for 'or' operation |
Script | Pointer to the entry. |
Definition at line 1278 of file BootScriptExecute.c.
EFI_STATUS InternalSmbusExecute | ( | IN UINTN | SmbusAddress, |
IN EFI_SMBUS_OPERATION | Operation, | ||
IN OUT UINTN * | Length, | ||
IN OUT VOID * | Buffer | ||
) |
Executes an SMBus operation to an SMBus controller. Returns when either the command has been executed or an error is encountered in doing the operation.
The SmbusExecute() function provides a standard way to execute an operation as defined in the System Management Bus (SMBus) Specification. The resulting transaction will be either that the SMBus slave devices accept this transaction or that this function returns with error.
SmbusAddress | Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, and PEC. |
Operation | Signifies which particular SMBus hardware protocol instance that it will use to execute the SMBus transactions. This SMBus hardware protocol is defined by the SMBus Specification and is not related to EFI. |
Length | Signifies the number of bytes that this operation will do. The maximum number of bytes can be revision specific and operation specific. This field will contain the actual number of bytes that are executed for this operation. Not all operations require this argument. |
Buffer | Contains the value of data to execute to the SMBus slave device. Not all operations require this argument. The length of this buffer is identified by Length. |
EFI_SUCCESS | The last data that was returned from the access matched the poll exit criteria. |
EFI_CRC_ERROR | Checksum is not correct (PEC is incorrect). |
EFI_TIMEOUT | Timeout expired before the operation was completed. Timeout is determined by the SMBus host controller device. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
EFI_DEVICE_ERROR | The request was not completed because a failure that was reflected in the Host Status Register bit. Device errors are a result of a transaction collision, illegal command field, unclaimed cycle (host initiated), or bus errors (collisions). |
EFI_INVALID_PARAMETER | Operation is not defined in EFI_SMBUS_OPERATION. |
EFI_INVALID_PARAMETER | Length/Buffer is NULL for operations except for EfiSmbusQuickRead and EfiSmbusQuickWrite. Length is outside the range of valid values. |
EFI_UNSUPPORTED | The SMBus operation or PEC is not supported. |
EFI_BUFFER_TOO_SMALL | Buffer is not sufficient for this operation. |
Definition at line 53 of file BootScriptExecute.c.
RETURN_STATUS EFIAPI S3BootScriptExecute | ( | VOID | ) |
Executes the S3 boot script table.
RETURN_SUCCESS | The boot script table was executed successfully. |
RETURN_UNSUPPORTED | Invalid script table or opcode. |
Definition at line 1627 of file BootScriptExecute.c.
EFI_STATUS ScriptIoRead | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
OUT VOID * | Buffer | ||
) |
Perform IO read operation
[in] | Width | Width of the operation. |
[in] | Address | Address of the operation. |
[in] | Count | Count of the number of accesses to perform. |
[out] | Buffer | Pointer to the buffer to read from I/O space. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. Address is outside the legal range of I/O ports. |
Definition at line 180 of file BootScriptExecute.c.
EFI_STATUS ScriptIoWrite | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
IN VOID * | Buffer | ||
) |
Perform IO write operation
[in] | Width | Width of the operation. |
[in] | Address | Address of the operation. |
[in] | Count | Count of the number of accesses to perform. |
[in] | Buffer | Pointer to the buffer to write to I/O space. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. Address is outside the legal range of I/O ports. |
Definition at line 284 of file BootScriptExecute.c.
EFI_STATUS ScriptMemoryRead | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
IN OUT VOID * | Buffer | ||
) |
Perform memory read operation
Width | Width of the operation. |
Address | Address of the operation. |
Count | Count of the number of accesses to perform. |
Buffer | Pointer to the buffer read from memory. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. |
EFI_UNSUPPORTED | The address range specified by Address, Width, and Count is not valid for this EFI System. |
Definition at line 422 of file BootScriptExecute.c.
EFI_STATUS ScriptMemoryWrite | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
IN OUT VOID * | Buffer | ||
) |
Perform memory write operation
Width | Width of the operation. |
Address | Address of the operation. |
Count | Count of the number of accesses to perform. |
Buffer | Pointer to the buffer write to memory. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. |
EFI_UNSUPPORTED | The address range specified by Address, Width, and Count is not valid for this EFI System. |
Definition at line 523 of file BootScriptExecute.c.
EFI_STATUS ScriptPciCfg2Read | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT16 | Segment, | ||
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
OUT VOID * | Buffer | ||
) |
Performance PCI configuration 2 read operation
Width | Width of the operation. |
Segment | Pci segment number |
Address | Address of the operation. |
Count | Count of the number of accesses to perform. |
Buffer | Pointer to the buffer read from PCI config space |
EFI_SUCCESS | The read succeed. |
EFI_INVALID_PARAMETER | if Width is not defined |
Definition at line 656 of file BootScriptExecute.c.
EFI_STATUS ScriptPciCfg2Write | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT16 | Segment, | ||
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
IN VOID * | Buffer | ||
) |
Performance PCI configuration 2 write operation
Width | Width of the operation. |
Segment | Pci segment number |
Address | Address of the operation. |
Count | Count of the number of accesses to perform. |
Buffer | Pointer to the buffer write to PCI config space |
EFI_SUCCESS | The write succeed. |
EFI_INVALID_PARAMETER | if Width is not defined |
Definition at line 746 of file BootScriptExecute.c.
EFI_STATUS ScriptPciCfgRead | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
OUT VOID * | Buffer | ||
) |
Performance PCI configuration read operation
Width | Width of the operation. |
Address | Address of the operation. |
Count | Count of the number of accesses to perform. |
Buffer | Pointer to the buffer to read from PCI config space. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. Address is outside the legal range of I/O ports. |
Definition at line 838 of file BootScriptExecute.c.
EFI_STATUS EFIAPI ScriptPciCfgWrite | ( | IN S3_BOOT_SCRIPT_LIB_WIDTH | Width, |
IN UINT64 | Address, | ||
IN UINTN | Count, | ||
IN VOID * | Buffer | ||
) |
Performance PCI configuration write operation
Width | Width of the operation. |
Address | Address of the operation. |
Count | Count of the number of accesses to perform. |
Buffer | Pointer to the buffer to write to PCI config space. |
EFI_SUCCESS | The data was written to the EFI System. |
EFI_INVALID_PARAMETER | Width is invalid for this EFI System. Buffer is NULL. The Buffer is not aligned for the given Width. Address is outside the legal range of I/O ports. |
Definition at line 865 of file BootScriptExecute.c.