/* To get the start address from which a new runtime(after SmmReadyToLock) s3 boot script entry will write into. In this case, it should be ensured that there is enough buffer to hold the entry. */
UINT8* S3BootScriptGetRuntimeEntryAddAddress(UINT8 EntryLength)
/* To get the start address from which a new runtime(after SmmReadyToLock) s3 boot script entry will write into. In this case, it should be ensured that there is enough buffer to hold the entry. */
UINT8* S3BootScriptGetRuntimeEntryAddAddress(UINT8 EntryLength)
{
  UINT8  *NewEntryPtr;
  NewEntryPtr = NULL;
  if ((mS3BootScriptTablePtr->TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE)) <= EFI_PAGES_TO_SIZE ((UINTN)(mS3BootScriptTablePtr->TableMemoryPageNumber))) {
    NewEntryPtr                        = mS3BootScriptTablePtr->TableBase + mS3BootScriptTablePtr->TableLength;
    mS3BootScriptTablePtr->TableLength = mS3BootScriptTablePtr->TableLength + EntryLength;
    S3BootScriptInternalCloseTable ();
  }
  return (UINT8 *)NewEntryPtr;
}