/* Note that DxeSmmReadyToLock must be signaled after this function returns; otherwise the script wouldn't be saved actually.  */
STATIC VOID SaveS3BootScript(VOID)
/* Note that DxeSmmReadyToLock must be signaled after this function returns; otherwise the script wouldn't be saved actually.  */
STATIC VOID SaveS3BootScript(VOID)
{
  EFI_STATUS                  Status;
  EFI_S3_SAVE_STATE_PROTOCOL  *BootScript;
  STATIC CONST UINT8          Info[] = { 0xDE, 0xAD, 0xBE, 0xEF };
  Status = gBS->LocateProtocol (
                  &gEfiS3SaveStateProtocolGuid,
                  NULL,
                  (VOID **)&BootScript
                  );
  ASSERT_EFI_ERROR (Status);
  Status = BootScript->Write (
                         BootScript,
                         EFI_BOOT_SCRIPT_INFORMATION_OPCODE,
                         (UINT32)sizeof Info,
                         (EFI_PHYSICAL_ADDRESS)(UINTN)&Info
                         );
  ASSERT_EFI_ERROR (Status);
}