105 0xaea6b965, 0xdcf5, 0x4311, { 0xb4, 0xb8, 0xf, 0x12, 0x46, 0x44, 0x94, 0xd2 }
108EFI_GUID mBootScriptDataBootTimeGuid = {
109 0xb5af1d7a, 0xb8cf, 0x4eb3, { 0x89, 0x25, 0xa8, 0x20, 0xe1, 0x6b, 0x68, 0x7d }
112EFI_GUID mBootScriptTableBaseGuid = {
113 0x1810ab4a, 0x2314, 0x4df6, { 0x81, 0xeb, 0x67, 0xc6, 0xec, 0x5, 0x85, 0x91 }
116EFI_GUID mBootScriptSmmPrivateDataGuid = {
117 0x627ee2da, 0x3bf9, 0x439b, { 0x92, 0x9f, 0x2e, 0xe, 0x6e, 0x9d, 0xba, 0x62 }
121VOID *mRegistrationSmmExitBootServices =
NULL;
122VOID *mRegistrationSmmLegacyBoot =
NULL;
123VOID *mRegistrationSmmReadyToLock =
NULL;
124BOOLEAN mS3BootScriptTableAllocated =
FALSE;
125BOOLEAN mS3BootScriptTableSmmAllocated =
FALSE;
127BOOLEAN mS3BootScriptAcpiS3Enable =
TRUE;
146 if (S3TableBase ==
NULL) {
190 &mBootScriptDataGuid,
204 &mBootScriptTableBaseGuid,
235 Status =
gBS->LocateProtocol (
236 &gEfiDxeSmmReadyToLockProtocolGuid,
240 if (EFI_ERROR (Status)) {
297 if (mS3BootScriptTableSmmPtr->TableBase ==
NULL) {
304 mS3BootScriptTableSmmPtr->InSmm =
TRUE;
336 &mBootScriptDataGuid,
347 &mBootScriptDataBootTimeGuid,
371 &mBootScriptSmmPrivateDataGuid,
377 Status =
SetLockBoxAttributes (&mBootScriptSmmPrivateDataGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);
442 mS3BootScriptAcpiS3Enable =
FALSE;
443 DEBUG ((DEBUG_INFO,
"%a: Skip S3BootScript because ACPI S3 disabled.\n", gEfiCallerBaseName));
451 if (S3TablePtr == 0) {
452 Buffer = SIZE_4GB - 1;
453 Status =
gBS->AllocatePages (
460 mS3BootScriptTableAllocated =
TRUE;
461 S3TablePtr = (VOID *)(
UINTN)Buffer;
463 Status =
PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, (UINT64)(
UINTN)S3TablePtr);
470 &gEfiDxeSmmReadyToLockProtocolGuid,
476 ASSERT (mEventDxeSmmReadyToLock !=
NULL);
484 Status =
gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid,
NULL, (VOID **)&SmmBase2);
485 if (EFI_ERROR (Status)) {
489 Status = SmmBase2->InSmm (SmmBase2, &
InSmm);
490 if (EFI_ERROR (Status)) {
501 Status = SmmBase2->GetSmstLocation (SmmBase2, &mBootScriptSmst);
502 if (EFI_ERROR (Status)) {
510 if (S3TableSmmPtr == 0) {
514 (VOID **)&S3TableSmmPtr
517 mS3BootScriptTableSmmAllocated =
TRUE;
519 Status =
PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, (UINT64)(
UINTN)S3TableSmmPtr);
526 Status = mBootScriptSmst->SmmRegisterProtocolNotify (
527 &gEdkiiSmmExitBootServicesProtocolGuid,
529 &mRegistrationSmmExitBootServices
533 Status = mBootScriptSmst->SmmRegisterProtocolNotify (
534 &gEdkiiSmmLegacyBootProtocolGuid,
536 &mRegistrationSmmLegacyBoot
541 mS3BootScriptTableSmmPtr = S3TableSmmPtr;
546 Status = mBootScriptSmst->SmmRegisterProtocolNotify (
547 &gEfiSmmReadyToLockProtocolGuid,
549 &mRegistrationSmmReadyToLock
578 if (!mS3BootScriptAcpiS3Enable) {
582 DEBUG ((DEBUG_INFO,
"%a() in %a module\n", __func__, gEfiCallerBaseName));
584 if (mEventDxeSmmReadyToLock !=
NULL) {
588 Status =
gBS->CloseEvent (mEventDxeSmmReadyToLock);
592 if (mBootScriptSmst !=
NULL) {
593 if (mRegistrationSmmExitBootServices !=
NULL) {
597 Status = mBootScriptSmst->SmmRegisterProtocolNotify (
598 &gEdkiiSmmExitBootServicesProtocolGuid,
600 &mRegistrationSmmExitBootServices
605 if (mRegistrationSmmLegacyBoot !=
NULL) {
609 Status = mBootScriptSmst->SmmRegisterProtocolNotify (
610 &gEdkiiSmmLegacyBootProtocolGuid,
612 &mRegistrationSmmLegacyBoot
617 if (mRegistrationSmmReadyToLock !=
NULL) {
621 Status = mBootScriptSmst->SmmRegisterProtocolNotify (
622 &gEfiSmmReadyToLockProtocolGuid,
624 &mRegistrationSmmReadyToLock
633 if (mS3BootScriptTableAllocated) {
636 Status =
PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, 0);
640 if ((mBootScriptSmst !=
NULL) && mS3BootScriptTableSmmAllocated) {
641 Status = mBootScriptSmst->SmmFreePool (mS3BootScriptTableSmmPtr);
643 Status =
PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, 0);
674 if (S3TableBase == 0) {
679 S3TableBase = 0xffffffff;
680 Status =
gBS->AllocatePages (
683 2 +
PcdGet16 (PcdS3BootScriptRuntimeTableReservePageNumber),
687 if (EFI_ERROR (Status)) {
698 ScriptTableInfo->Version = BOOT_SCRIPT_TABLE_VERSION;
699 ScriptTableInfo->TableLength = 0;
712 NewS3TableBase = 0xffffffff;
713 Status =
gBS->AllocatePages (
716 2 + PageNumber +
PcdGet16 (PcdS3BootScriptRuntimeTableReservePageNumber),
720 if (EFI_ERROR (Status)) {
725 CopyMem ((VOID *)(
UINTN)NewS3TableBase, (VOID *)(
UINTN)S3TableBase, TableLength);
780 return (UINT8 *)NewEntryPtr;
800 &mBootScriptDataBootTimeGuid,
810 &mBootScriptDataGuid,
837 if (!mS3BootScriptAcpiS3Enable) {
850 DEBUG ((DEBUG_ERROR,
"FATAL ERROR: Set boot script outside SMM after SmmReadyToLock!!!\n"));
884 UINT32 TotalScriptLength;
903 &mBootScriptDataGuid,
906 TotalScriptLength - ScriptOffset
915 &mBootScriptDataGuid,
918 sizeof (TotalScriptLength)
961 if (S3TableBase == 0) {
973 Status =
gBS->AllocatePool (
978 if (EFI_ERROR (Status)) {
982 CopyMem (Buffer, S3TableBase, TableLength);
992 ScriptTableInfo->TableLength = 0;
1024 if (!mS3BootScriptAcpiS3Enable) {
1028 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1033 if ((Count > MAX_UINT8) ||
1042 if (Script ==
NULL) {
1087 if (!mS3BootScriptAcpiS3Enable) {
1091 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1095 if (Script ==
NULL) {
1102 ScriptIoReadWrite.OpCode = EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE;
1103 ScriptIoReadWrite.Length = Length;
1104 ScriptIoReadWrite.Width = Width;
1105 ScriptIoReadWrite.Address = Address;
1141 if (!mS3BootScriptAcpiS3Enable) {
1145 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1150 if ((Count > MAX_UINT8) ||
1159 if (Script ==
NULL) {
1166 ScriptMemWrite.OpCode = EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE;
1167 ScriptMemWrite.Length = Length;
1168 ScriptMemWrite.Width = Width;
1169 ScriptMemWrite.Address = Address;
1170 ScriptMemWrite.Count = (UINT32)Count;
1205 if (!mS3BootScriptAcpiS3Enable) {
1209 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1213 if (Script ==
NULL) {
1220 ScriptMemReadWrite.OpCode = EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE;
1221 ScriptMemReadWrite.Length = Length;
1222 ScriptMemReadWrite.Width = Width;
1223 ScriptMemReadWrite.Address = Address;
1261 if (!mS3BootScriptAcpiS3Enable) {
1269 return EFI_INVALID_PARAMETER;
1272 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1277 if ((Count > MAX_UINT8) ||
1286 if (Script ==
NULL) {
1293 ScriptPciWrite.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE;
1294 ScriptPciWrite.Length = Length;
1295 ScriptPciWrite.Width = Width;
1296 ScriptPciWrite.Address = Address;
1297 ScriptPciWrite.Count = (UINT32)Count;
1334 if (!mS3BootScriptAcpiS3Enable) {
1342 return EFI_INVALID_PARAMETER;
1345 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1349 if (Script ==
NULL) {
1356 ScriptPciReadWrite.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE;
1357 ScriptPciReadWrite.Length = Length;
1358 ScriptPciReadWrite.Width = Width;
1359 ScriptPciReadWrite.Address = Address;
1403 if (!mS3BootScriptAcpiS3Enable) {
1411 return EFI_INVALID_PARAMETER;
1414 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1419 if ((Count > MAX_UINT8) ||
1428 if (Script ==
NULL) {
1435 ScriptPciWrite2.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE;
1436 ScriptPciWrite2.Length = Length;
1437 ScriptPciWrite2.Width = Width;
1438 ScriptPciWrite2.Address = Address;
1439 ScriptPciWrite2.Segment = Segment;
1440 ScriptPciWrite2.Count = (UINT32)Count;
1479 if (!mS3BootScriptAcpiS3Enable) {
1487 return EFI_INVALID_PARAMETER;
1490 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1494 if (Script ==
NULL) {
1501 ScriptPciReadWrite2.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE;
1502 ScriptPciReadWrite2.Length = Length;
1503 ScriptPciReadWrite2.Width = Width;
1504 ScriptPciReadWrite2.Segment = Segment;
1505 ScriptPciReadWrite2.Address = Address;
1573 switch (Operation) {
1574 case EfiSmbusQuickRead:
1575 case EfiSmbusQuickWrite:
1576 if (PecCheck || (Command != 0)) {
1577 return EFI_UNSUPPORTED;
1581 case EfiSmbusReceiveByte:
1582 case EfiSmbusSendByte:
1584 return EFI_UNSUPPORTED;
1590 case EfiSmbusReadByte:
1591 case EfiSmbusWriteByte:
1596 case EfiSmbusReadWord:
1597 case EfiSmbusWriteWord:
1598 case EfiSmbusProcessCall:
1599 if ((Buffer ==
NULL) || (Length ==
NULL)) {
1600 return EFI_INVALID_PARAMETER;
1601 }
else if (*Length < RequiredLen) {
1602 Status = EFI_BUFFER_TOO_SMALL;
1605 *Length = RequiredLen;
1607 case EfiSmbusReadBlock:
1608 case EfiSmbusWriteBlock:
1609 case EfiSmbusBWBRProcessCall:
1610 if ((Buffer ==
NULL) ||
1612 (*Length < MIN_SMBUS_BLOCK_LEN) ||
1613 (*Length > MAX_SMBUS_BLOCK_LEN))
1615 return EFI_INVALID_PARAMETER;
1620 return EFI_INVALID_PARAMETER;
1653 if (!mS3BootScriptAcpiS3Enable) {
1657 if (Length ==
NULL) {
1660 BufferLength = *Length;
1663 Status =
CheckParameters (SmBusAddress, Operation, &BufferLength, Buffer);
1664 if (EFI_ERROR (Status)) {
1678 if (Script ==
NULL) {
1685 ScriptSmbusExecute.OpCode = EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE;
1686 ScriptSmbusExecute.Length = DataSize;
1687 ScriptSmbusExecute.SmBusAddress = (UINT64)SmBusAddress;
1688 ScriptSmbusExecute.Operation = Operation;
1689 ScriptSmbusExecute.DataSize = (UINT32)BufferLength;
1721 if (!mS3BootScriptAcpiS3Enable) {
1728 if (Script ==
NULL) {
1735 ScriptStall.OpCode = EFI_BOOT_SCRIPT_STALL_OPCODE;
1736 ScriptStall.Length = Length;
1737 ScriptStall.Duration = Duration;
1758 IN VOID *EntryPoint,
1766 if (!mS3BootScriptAcpiS3Enable) {
1773 if (Script ==
NULL) {
1780 ScriptDispatch2.OpCode = EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE;
1781 ScriptDispatch2.Length = Length;
1828 if (!mS3BootScriptAcpiS3Enable) {
1832 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
1837 if (Script ==
NULL) {
1844 ScriptMemPoll.OpCode = EFI_BOOT_SCRIPT_MEM_POLL_OPCODE;
1845 ScriptMemPoll.Length = Length;
1846 ScriptMemPoll.Width = Width;
1847 ScriptMemPoll.Address = Address;
1848 ScriptMemPoll.Duration = Duration;
1849 ScriptMemPoll.LoopTimes = LoopTimes;
1874 IN UINT32 InformationLength,
1875 IN VOID *Information
1882 if (!mS3BootScriptAcpiS3Enable) {
1896 if (Script ==
NULL) {
1903 ScriptInformation.OpCode = EFI_BOOT_SCRIPT_INFORMATION_OPCODE;
1904 ScriptInformation.Length = Length;
1906 ScriptInformation.InformationLength = InformationLength;
1956 if (!mS3BootScriptAcpiS3Enable) {
1963 if (Script ==
NULL) {
1970 ScriptDispatch.OpCode = EFI_BOOT_SCRIPT_DISPATCH_OPCODE;
1971 ScriptDispatch.Length = Length;
2012 if (!mS3BootScriptAcpiS3Enable) {
2016 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
2020 if (Script ==
NULL) {
2027 ScriptIoPoll.OpCode = EFI_BOOT_SCRIPT_IO_POLL_OPCODE;
2029 ScriptIoPoll.Width = Width;
2030 ScriptIoPoll.Address = Address;
2031 ScriptIoPoll.Delay = Delay;
2074 if (!mS3BootScriptAcpiS3Enable) {
2082 return EFI_INVALID_PARAMETER;
2085 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
2089 if (Script ==
NULL) {
2096 ScriptPciPoll.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE;
2098 ScriptPciPoll.Width = Width;
2099 ScriptPciPoll.Address = Address;
2100 ScriptPciPoll.Delay = Delay;
2145 if (!mS3BootScriptAcpiS3Enable) {
2153 return EFI_INVALID_PARAMETER;
2156 WidthInByte = (UINT8)(0x01 << (Width & 0x03));
2160 if (Script ==
NULL) {
2167 ScriptPci2Poll.OpCode = EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE;
2169 ScriptPci2Poll.Width = Width;
2170 ScriptPci2Poll.Segment = Segment;
2171 ScriptPci2Poll.Address = Address;
2172 ScriptPci2Poll.Delay = Delay;
2195 IN UINT8 EntryLength,
2196 IN VOID *Position OPTIONAL,
2197 IN BOOLEAN BeforeOrAfter OPTIONAL,
2203 UINTN PositionOffset;
2214 if (Position !=
NULL) {
2215 PositionOffset = (
UINTN)Position - (
UINTN)S3TableBase;
2220 if (!BeforeOrAfter) {
2222 PositionOffset += (ScriptHeader.Length);
2228 CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset);
2232 *Script = S3TableBase + PositionOffset;
2234 if (!BeforeOrAfter) {
2238 *Script = S3TableBase + TableLength;
2244 CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset);
2245 *Script = S3TableBase + PositionOffset;
2268 IN BOOLEAN BeforeOrAfter,
2269 IN OUT VOID **Position OPTIONAL
2277 BOOLEAN ValidatePosition;
2279 UINT8 TempBootScriptEntry[BOOT_SCRIPT_NODE_MAX_LENGTH];
2281 if (!mS3BootScriptAcpiS3Enable) {
2285 ValidatePosition =
FALSE;
2286 TempPosition = (Position ==
NULL) ?
NULL : (*Position);
2292 if (Script ==
NULL) {
2298 StartAddress = (
UINTN)Script;
2301 LastOpcode = Script;
2305 while ((
UINTN)Script < (
UINTN)(StartAddress + TableLength)) {
2307 if ((TempPosition !=
NULL) && (TempPosition == Script)) {
2311 ValidatePosition =
TRUE;
2315 LastOpcode = Script;
2318 Script = Script + ScriptHeader.Length;
2324 if ((TempPosition !=
NULL) && !ValidatePosition) {
2330 CopyMem ((VOID *)TempBootScriptEntry, LastOpcode, ScriptHeader.Length);
2335 ScriptHeader.Length,
2343 CopyMem ((VOID *)Script, (VOID *)TempBootScriptEntry, ScriptHeader.Length);
2350 if (Position !=
NULL) {
2378 IN BOOLEAN BeforeOrAfter,
2379 IN OUT VOID **Position OPTIONAL,
2380 IN UINT32 InformationLength,
2388 if (!mS3BootScriptAcpiS3Enable) {
2402 if (Script ==
NULL) {
2409 ScriptInformation.OpCode = S3_BOOT_SCRIPT_LIB_LABEL_OPCODE;
2410 ScriptInformation.Length = Length;
2412 ScriptInformation.InformationLength = InformationLength;
2447 IN BOOLEAN BeforeOrAfter,
2448 IN BOOLEAN CreateIfNotFound,
2449 IN OUT VOID **Position OPTIONAL,
2460 if (!mS3BootScriptAcpiS3Enable) {
2467 if (Label ==
NULL) {
2468 return EFI_INVALID_PARAMETER;
2474 if (Label[0] ==
'\0') {
2475 return EFI_INVALID_PARAMETER;
2484 if (Script ==
NULL) {
2494 return EFI_INVALID_PARAMETER;
2497 StartAddress = (
UINTN)Script;
2499 Script = Script + TableHeader.Length;
2500 while ((
UINTN)Script < (
UINTN)(StartAddress + TableLength)) {
2502 if (ScriptHeader.OpCode == S3_BOOT_SCRIPT_LIB_LABEL_OPCODE) {
2504 (*Position) = Script;
2509 Script = Script + ScriptHeader.Length;
2512 if (CreateIfNotFound) {
2516 return EFI_NOT_FOUND;
2537 IN UINT8 *Position1,
2538 IN UINT8 *Position2,
2545 if (!mS3BootScriptAcpiS3Enable) {
2549 if (RelativePosition ==
NULL) {
2550 return EFI_INVALID_PARAMETER;
2557 if (Script ==
NULL) {
2567 if ((Position1 < Script) || (Position1 > Script+TableLength)) {
2568 return EFI_INVALID_PARAMETER;
2571 if ((Position2 < Script) || (Position2 > Script+TableLength)) {
2572 return EFI_INVALID_PARAMETER;
2575 *RelativePosition = (Position1 < Position2) ? -1 : ((Position1 == Position2) ? 0 : 1);
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS ScriptIoWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
VOID SaveSmmPriviateDataToLockBoxAtRuntime(VOID)
RETURN_STATUS EFIAPI S3BootScriptSaveInformation(IN UINT32 InformationLength, IN VOID *Information)
EFI_STATUS EFIAPI S3BootScriptSmmEventCallBack(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
EFI_STATUS CheckParameters(IN UINTN SmBusAddress, IN EFI_SMBUS_OPERATION Operation, IN OUT UINTN *Length, IN VOID *Buffer)
RETURN_STATUS EFIAPI S3BootScriptSaveIoPoll(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask, IN UINT64 Delay)
RETURN_STATUS EFIAPI S3BootScriptSavePciCfg2ReadWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT16 Segment, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask)
RETURN_STATUS EFIAPI S3BootScriptSavePci2Poll(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT16 Segment, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask, IN UINT64 Delay)
RETURN_STATUS EFIAPI S3BootScriptSaveDispatch2(IN VOID *EntryPoint, IN VOID *Context)
RETURN_STATUS EFIAPI S3BootScriptSaveIoReadWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask)
RETURN_STATUS EFIAPI S3BootScriptLibInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
RETURN_STATUS EFIAPI S3BootScriptSaveIoWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
UINT8 * S3BootScriptGetRuntimeEntryAddAddress(UINT8 EntryLength)
RETURN_STATUS EFIAPI S3BootScriptSavePciCfgWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
RETURN_STATUS EFIAPI S3BootScriptSaveInformationAsciiString(IN CONST CHAR8 *String)
RETURN_STATUS EFIAPI S3BootScriptCompare(IN UINT8 *Position1, IN UINT8 *Position2, OUT UINTN *RelativePosition)
VOID SyncBootScript(IN UINT8 *Script)
VOID SaveBootScriptDataToLockBox(VOID)
UINT8 * S3BootScriptGetBootTimeEntryAddAddress(UINT8 EntryLength)
VOID EFIAPI S3BootScriptEventCallBack(IN EFI_EVENT Event, IN VOID *Context)
RETURN_STATUS EFIAPI S3BootScriptSaveStall(IN UINTN Duration)
UINT8 * S3BootScriptGetEntryAddAddress(UINT8 EntryLength)
RETURN_STATUS EFIAPI S3BootScriptSaveSmbusExecute(IN UINTN SmBusAddress, IN EFI_SMBUS_OPERATION Operation, IN UINTN *Length, IN VOID *Buffer)
RETURN_STATUS EFIAPI S3BootScriptLabelInternal(IN BOOLEAN BeforeOrAfter, IN OUT VOID **Position OPTIONAL, IN UINT32 InformationLength, IN CONST CHAR8 *Information)
RETURN_STATUS EFIAPI S3BootScriptSaveMemPoll(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN VOID *BitMask, IN VOID *BitValue, IN UINTN Duration, IN UINT64 LoopTimes)
VOID RestoreBootTimeDataFromLockBox(VOID)
RETURN_STATUS EFIAPI S3BootScriptSavePciCfg2Write(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT16 Segment, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
EFI_STATUS EFIAPI S3BootScriptSmmAtRuntimeCallBack(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
UINT8 * S3BootScriptInternalCloseTable(VOID)
RETURN_STATUS EFIAPI S3BootScriptSaveDispatch(IN VOID *EntryPoint)
RETURN_STATUS EFIAPI S3BootScriptLibDeinitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID S3BootScriptCalculateInsertAddress(IN UINT8 EntryLength, IN VOID *Position OPTIONAL, IN BOOLEAN BeforeOrAfter OPTIONAL, OUT UINT8 **Script)
RETURN_STATUS EFIAPI S3BootScriptMoveLastOpcode(IN BOOLEAN BeforeOrAfter, IN OUT VOID **Position OPTIONAL)
RETURN_STATUS EFIAPI S3BootScriptSavePciCfgReadWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask)
RETURN_STATUS EFIAPI S3BootScriptSaveMemWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
UINT8 *EFIAPI S3BootScriptCloseTable(VOID)
SCRIPT_TABLE_PRIVATE_DATA * mS3BootScriptTablePtr
VOID SaveBootTimeDataToLockBox(VOID)
RETURN_STATUS EFIAPI S3BootScriptLabel(IN BOOLEAN BeforeOrAfter, IN BOOLEAN CreateIfNotFound, IN OUT VOID **Position OPTIONAL, IN CONST CHAR8 *Label)
RETURN_STATUS EFIAPI S3BootScriptSaveMemReadWrite(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask)
RETURN_STATUS EFIAPI S3BootScriptSavePciPoll(IN S3_BOOT_SCRIPT_LIB_WIDTH Width, IN UINT64 Address, IN VOID *Data, IN VOID *DataMask, IN UINT64 Delay)
#define S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE
#define S3_BOOT_SCRIPT_LIB_TABLE_OPCODE
RETURN_STATUS EFIAPI SetLockBoxAttributes(IN GUID *Guid, IN UINT64 Attributes)
RETURN_STATUS EFIAPI RestoreLockBox(IN GUID *Guid, IN VOID *Buffer OPTIONAL, IN OUT UINTN *Length OPTIONAL)
RETURN_STATUS EFIAPI UpdateLockBox(IN GUID *Guid, IN UINTN Offset, IN VOID *Buffer, IN UINTN Length)
RETURN_STATUS EFIAPI SaveLockBox(IN GUID *Guid, IN VOID *Buffer, IN UINTN Length)
#define RETURN_OUT_OF_RESOURCES
#define OFFSET_OF(TYPE, Field)
#define RETURN_INVALID_PARAMETER
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define PcdGet16(TokenName)
#define PcdGet64(TokenName)
#define PcdGetBool(TokenName)
#define PcdSet64S(TokenName, Value)
BOOLEAN EFIAPI InSmm(VOID)
@ S3BootScriptWidthFifoUint64
64-bit FIFO operation.
@ S3BootScriptWidthUint64
64-bit operation.
@ S3BootScriptWidthFillUint64
64-bit Fill operation.
UINTN EFI_SMBUS_DEVICE_COMMAND
enum _EFI_SMBUS_OPERATION EFI_SMBUS_OPERATION
#define SMBUS_LIB_COMMAND(SmBusAddress)
#define SMBUS_LIB_PEC(SmBusAddress)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_SIZE_TO_PAGES(Size)
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
EFI_ALLOCATE_POOL SmmAllocatePool