Home | History | Annotate | Download | only in PiDxeS3BootScriptLib

Lines Matching defs:Script

2   Save the S3 data to S3 boot script.

46 to handle potential INSERT boot script | |
49 | Boot Time Boot Script | | |
54 | Boot Time Boot Script | | |
63 | Boot Time Boot Script | | |
68 | Boot Time Boot Script | | |
72 | Runtime Boot Script | |
139 @return the base address of the boot script table.
181 This function save boot script data to LockBox.
258 // node on every add to boot script table.
307 // Set InSmm, we allow boot script update when InSmm, but not allow boot script outside SMM.
321 This function is to save boot time boot script data to LockBox.
323 Because there may be INSERT boot script at runtime in SMM.
325 Otherwise the data inserted may cause some boot time boot script data lost
360 This function save boot script SMM private data to LockBox with BackFromS3 = TRUE at runtime.
372 // Save boot script SMM private data with BackFromS3 = TRUE.
448 // The Boot script private data is not be initialized. create it
503 // The Boot script private data in SMM is not be initialized. create it
638 To get the start address from which a new boot time s3 boot script entry will write into.
645 @retval the address from which the a new s3 boot script entry will write into
664 // Allocate ACPI script table space under 4G memory.
691 // Here we do not count the reserved memory for runtime script table.
728 // In the boot time, we will not append the termination entry to the boot script
737 To get the start address from which a new runtime(after SmmReadyToLock) s3 boot script entry will write into.
742 @retval the address from which the a new s3 runtime(after SmmReadyToLock) script entry will write into
753 // Check if the memory range reserved for S3 Boot Script table is large enough to hold the node.
767 This function is to restore boot time boot script data from LockBox.
779 // Restore boot time boot script data from LockBox.
807 To get the start address from which a new s3 boot script entry will write into.
811 @retval the address from which the a new s3 boot script entry will write into
822 // We need check InSmm, because after SmmReadyToLock, only SMM driver is allowed to write boot script.
829 DEBUG ((EFI_D_ERROR, "FATAL ERROR: Set boot script outside SMM after SmmReadyToLock!!!\n"));
835 // Back from S3, restore boot time boot script data from LockBox
853 @param Script The address from where the boot script has been added or updated.
858 IN UINT8 *Script
873 ScriptOffset = (UINT32) (Script - mS3BootScriptTablePtr->TableBase);
903 This is an function to close the S3 boot script table. The function could only be called in
906 1. Closes the specified boot script table
910 3. Any attempts to add a script record after calling this function will cause a new table
913 using the boot script table, the CALLER is responsible for freeing the pool that is allocated
920 how to get the script to run at S3 resume because the boot script maintained by the lib will be
923 @return the base address of the new copy of the boot script table.
944 // Append the termination record the S3 boot script table
949 // Allocate the buffer and copy the boot script to the buffer.
975 Save I/O write to boot script
996 UINT8 *Script;
1003 Script = S3BootScriptGetEntryAddAddress (Length);
1004 if (Script == NULL) {
1008 // save script data
1015 CopyMem ((VOID*)Script, (VOID*)&ScriptIoWrite, sizeof(EFI_BOOT_SCRIPT_IO_WRITE));
1016 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_WRITE)), Buffer, WidthInByte * Count);
1018 SyncBootScript (Script);
1024 Adds a record for an I/O modify operation into a S3 boot script table
1044 UINT8 *Script;
1051 Script = S3BootScriptGetEntryAddAddress (Length);
1052 if (Script == NULL) {
1056 // Build script data
1063 CopyMem ((VOID*)Script, (VOID*)&ScriptIoReadWrite, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE));
1064 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE)), Data, WidthInByte);
1065 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE) + WidthInByte), DataMask, WidthInByte);
1067 SyncBootScript (Script);
1072 Adds a record for a memory write operation into a specified boot script table.
1092 UINT8 *Script;
1099 Script = S3BootScriptGetEntryAddAddress (Length);
1100 if (Script == NULL) {
1104 // Build script data
1112 CopyMem ((VOID*)Script, (VOID*)&ScriptMemWrite, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE));
1113 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_WRITE)), Buffer, WidthInByte * Count);
1115 SyncBootScript (Script);
1120 Adds a record for a memory modify operation into a specified boot script table.
1140 UINT8 *Script;
1147 Script = S3BootScriptGetEntryAddAddress (Length);
1148 if (Script == NULL) {
1152 // Build script data
1159 CopyMem ((VOID*)Script, (VOID*)&ScriptMemReadWrite , sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE));
1160 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE)), Data, WidthInByte);
1161 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE) + WidthInByte), DataMask, WidthInByte);
1163 SyncBootScript (Script);
1168 Adds a record for a PCI configuration space write operation into a specified boot script table.
1190 UINT8 *Script;
1203 Script = S3BootScriptGetEntryAddAddress (Length);
1204 if (Script == NULL) {
1208 // Build script data
1216 CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE));
1217 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE)), Buffer, WidthInByte * Count);
1219 SyncBootScript (Script);
1224 Adds a record for a PCI configuration space modify operation into a specified boot script table.
1246 UINT8 *Script;
1259 Script = S3BootScriptGetEntryAddAddress (Length);
1260 if (Script == NULL) {
1264 // Build script data
1271 CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE));
1272 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE)), Data, WidthInByte);
1274 (VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE) + WidthInByte),
1279 SyncBootScript (Script);
1284 Adds a record for a PCI configuration 2 space write operation into a specified boot script table.
1308 UINT8 *Script;
1321 Script = S3BootScriptGetEntryAddAddress (Length);
1322 if (Script == NULL) {
1326 // Build script data
1335 CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE));
1336 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE)), Buffer, WidthInByte * Count);
1338 SyncBootScript (Script);
1343 Adds a record for a PCI configuration 2 space modify operation into a specified boot script table.
1367 UINT8 *Script;
1380 Script = S3BootScriptGetEntryAddAddress (Length);
1381 if (Script == NULL) {
1385 // Build script data
1393 CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE));
1394 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE)), Data, WidthInByte);
1396 (VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE) + WidthInByte),
1401 SyncBootScript (Script);
1507 Adds a record for an SMBus command execution into a specified boot script table.
1530 UINT8 *Script;
1546 Script = S3BootScriptGetEntryAddAddress (DataSize);
1547 if (Script == NULL) {
1551 // Build script data
1559 CopyMem ((VOID*)Script, (VOID*)&ScriptSmbusExecute, sizeof (EFI_BOOT_SCRIPT_SMBUS_EXECUTE));
1561 (VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_SMBUS_EXECUTE)),
1566 SyncBootScript (Script);
1571 Adds a record for an execution stall on the processor into a specified boot script table.
1585 UINT8 *Script;
1590 Script = S3BootScriptGetEntryAddAddress (Length);
1591 if (Script == NULL) {
1595 // Build script data
1601 CopyMem ((VOID*)Script, (VOID*)&ScriptStall, sizeof (EFI_BOOT_SCRIPT_STALL));
1603 SyncBootScript (Script);
1608 Adds a record for dispatching specified arbitrary code into a specified boot script table.
1624 UINT8 *Script;
1628 Script = S3BootScriptGetEntryAddAddress (Length);
1629 if (Script == NULL) {
1633 // Build script data
1640 CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch2, sizeof (EFI_BOOT_SCRIPT_DISPATCH_2));
1642 SyncBootScript (Script);
1679 UINT8 *Script;
1687 Script = S3BootScriptGetEntryAddAddress (Length);
1688 if (Script == NULL) {
1692 // Build script data
1701 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL)), BitValue, WidthInByte);
1702 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL) + WidthInByte), BitMask, WidthInByte);
1703 CopyMem ((VOID*)Script, (VOID*)&ScriptMemPoll, sizeof (EFI_BOOT_SCRIPT_MEM_POLL));
1705 SyncBootScript (Script);
1710 Store arbitrary information in the boot script table. This opcode is a no-op on dispatch and is only
1711 used for debugging script issues.
1728 UINT8 *Script;
1733 Script = S3BootScriptGetEntryAddAddress (Length);
1734 if (Script == NULL) {
1738 // Build script data
1746 CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION));
1747 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION)), (VOID *) Information, (UINTN) InformationLength);
1749 SyncBootScript (Script);
1755 Store a string in the boot script table. This opcode is a no-op on dispatch and is only
1756 used for debugging script issues.
1758 @param String The string to save to boot script table
1776 Adds a record for dispatching specified arbitrary code into a specified boot script table.
1790 UINT8 *Script;
1795 Script = S3BootScriptGetEntryAddAddress (Length);
1796 if (Script == NULL) {
1800 // Build script data
1806 CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch, sizeof (EFI_BOOT_SCRIPT_DISPATCH));
1808 SyncBootScript (Script);
1840 UINT8 *Script;
1848 Script = S3BootScriptGetEntryAddAddress (Length);
1849 if (Script == NULL) {
1853 // Build script data
1861 CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL));
1862 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL)), Data, WidthInByte);
1863 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL) + WidthInByte), DataMask, WidthInByte);
1865 SyncBootScript (Script);
1897 UINT8 *Script;
1911 Script = S3BootScriptGetEntryAddAddress (Length);
1912 if (Script == NULL) {
1916 // Build script data
1924 CopyMem ((VOID*)Script, (VOID*)&ScriptPciPoll, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL));
1925 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL)), Data, WidthInByte);
1926 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + WidthInByte), DataMask, WidthInByte);
1928 SyncBootScript (Script);
1962 UINT8 *Script;
1975 Script = S3BootScriptGetEntryAddAddress (Length);
1976 if (Script == NULL) {
1980 // Build script data
1989 CopyMem ((VOID*)Script, (VOID*)&ScriptPci2Poll, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL));
1990 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL)), Data, WidthInByte);
1991 CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + WidthInByte), DataMask, WidthInByte);
1993 SyncBootScript (Script);
1998 Do the calculation of start address from which a new s3 boot script entry will write into.
2001 @param Position specifies the position in the boot script table where the opcode will be
2005 @param Script return out the position from which the a new s3 boot script entry will write into
2012 OUT UINT8 **Script
2044 *Script = S3TableBase + PositionOffset;
2051 *Script = S3TableBase + TableLength;
2058 *Script = S3TableBase + PositionOffset;
2063 Move the last boot script entry to the position
2066 in the boot script table specified by Position. If Position is NULL or points to
2069 @param Position On entry, specifies the position in the boot script table where the opcode will be
2071 the position of the inserted opcode in the boot script table.
2074 @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the boot script table.
2084 UINT8* Script;
2097 // Check that the script is initialized and synced without adding an entry to the script.
2099 Script = S3BootScriptGetEntryAddAddress (0);
2100 if (Script == NULL) {
2103 Script = mS3BootScriptTablePtr->TableBase;
2105 StartAddress = (UINTN) Script;
2107 Script = Script + sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER);
2108 LastOpcode = Script;
2110 // Find the last boot Script Entry which is not the terminate node
2112 while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {
2113 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));
2114 if (TempPosition != NULL && TempPosition == Script) {
2116 // If the position is specified, the position must be pointed to a boot script entry start address.
2121 LastOpcode = Script;
2123 Script = Script + ScriptHeader.Length;
2126 // If the position is specified, but not the start of a boot script entry, it is a invalid input
2142 &Script
2145 // Copy the node to Boot script table
2147 CopyMem((VOID*)Script, (VOID*)TempBootScriptEntry, ScriptHeader.Length);
2149 SyncBootScript (Script);
2155 *Position = Script;
2160 Create a Label node in the boot script table.
2163 in the boot script table specified by Position. If Position is NULL or points to
2166 @param Position On entry, specifies the position in the boot script table where the opcode will be
2168 the position of the inserted opcode in the boot script table.
2172 @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the boot script table.
2187 UINT8 *Script;
2192 Script = S3BootScriptGetEntryAddAddress (Length);
2193 if (Script == NULL) {
2197 // Build script data
2205 CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION));
2206 CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION)), (VOID *) Information, (UINTN) InformationLength);
2208 SyncBootScript (Script);
2214 Find a label within the boot script table and, if not present, optionally create it.
2217 or after (FALSE) the position in the boot script table
2221 @param Position On entry, specifies the position in the boot script table
2224 of the inserted opcode in the boot script table.
2225 @param Label Points to the label which will be inserted in the boot script table.
2228 specified script table.
2229 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
2232 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
2244 UINT8* Script;
2264 // Check that the script is initialized and synced without adding an entry to the script.
2268 Script = S3BootScriptGetEntryAddAddress (0);
2269 if (Script == NULL) {
2276 Script = mS3BootScriptTablePtr->TableBase;
2277 CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));
2281 StartAddress = (UINTN) Script;
2283 Script = Script + TableHeader.Length;
2284 while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {
2286 CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));
2288 if (AsciiStrCmp ((CHAR8 *)(UINTN)(Script
2289 (*Position) = Script;
2293 Script = Script + ScriptHeader.Length;
2304 Compare two positions in the boot script table and return their relative position.
2305 @param Position1 The positions in the boot script table to compare
2306 @param Position2 The positions in the boot script table to compare
2310 specified script table.
2311 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
2314 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
2325 UINT8* Script;
2333 // Check that the script is initialized and synced without adding an entry to the script.
2335 Script = S3BootScriptGetEntryAddAddress (0);
2336 if (Script == NULL) {
2339 Script = mS3BootScriptTablePtr->TableBase;
2345 if (Position1 < Script || Position1 > Script+TableLength) {
2348 if (Position2 < Script || Position2 > Script+TableLength) {