/* This routine is entry point of ScriptSave driver. */
EFI_STATUS EFIAPI InitializeS3SaveState(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
/* This routine is entry point of ScriptSave driver. */
EFI_STATUS EFIAPI InitializeS3SaveState(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
{
  EFI_STATUS  Status;
  EFI_EVENT   EndOfDxeEvent;
  if (!PcdGetBool (PcdAcpiS3Enable)) {
    return EFI_UNSUPPORTED;
  }
  Status = gBS->CreateEventEx (
                  EVT_NOTIFY_SIGNAL,
                  TPL_CALLBACK,
                  AcpiS3ContextSaveOnEndOfDxe,
                  NULL,
                  &gEfiEndOfDxeEventGroupGuid,
                  &EndOfDxeEvent
                  );
  ASSERT_EFI_ERROR (Status);
  return gBS->InstallProtocolInterface (
                &mHandle,
                &gEfiS3SaveStateProtocolGuid,
                EFI_NATIVE_INTERFACE,
                &mS3SaveState
                );
}