]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Library / PiDxeS3BootScriptLib / BootScriptSave.c
index 9ff5b80e7a3683057f1bfd621b77a1a35f30e535..c116727531d27ce882ec47f260608fb37fd050f2 100644 (file)
@@ -1,16 +1,9 @@
 /** @file\r
   Save the S3 data to S3 boot script.\r
 \r
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions\r
-  of the BSD License which accompanies this distribution.  The\r
-  full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 #include "InternalBootScriptLib.h"\r
@@ -691,7 +684,7 @@ S3BootScriptGetBootTimeEntryAddAddress (
    // Here we do not count the reserved memory for runtime script table.\r
    PageNumber = (UINT16) (mS3BootScriptTablePtr->TableMemoryPageNumber - PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));\r
    TableLength =  mS3BootScriptTablePtr->TableLength;\r
-   if ((UINTN) EFI_PAGES_TO_SIZE ((UINTN) PageNumber) < (UINTN) (TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE))) {\r
+   if (EFI_PAGES_TO_SIZE ((UINTN) PageNumber) < (TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE))) {\r
      //\r
      // The buffer is too small to hold the table, Reallocate the buffer\r
      //\r
@@ -752,7 +745,7 @@ S3BootScriptGetRuntimeEntryAddAddress (
    //\r
    // Check if the memory range reserved for S3 Boot Script table is large enough to hold the node.\r
    //\r
-   if ((UINTN) (mS3BootScriptTablePtr->TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE)) <= (UINTN) EFI_PAGES_TO_SIZE ((UINTN) (mS3BootScriptTablePtr->TableMemoryPageNumber))) {\r
+   if ((mS3BootScriptTablePtr->TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE)) <= EFI_PAGES_TO_SIZE ((UINTN) (mS3BootScriptTablePtr->TableMemoryPageNumber))) {\r
      NewEntryPtr = mS3BootScriptTablePtr->TableBase + mS3BootScriptTablePtr->TableLength;\r
      mS3BootScriptTablePtr->TableLength = mS3BootScriptTablePtr->TableLength + EntryLength;\r
      //\r
@@ -1672,7 +1665,7 @@ S3BootScriptSaveMemPoll (
   IN  VOID                              *BitMask,\r
   IN  VOID                              *BitValue,\r
   IN  UINTN                             Duration,\r
-  IN  UINT                            LoopTimes\r
+  IN  UINT64                            LoopTimes\r
   )\r
 {\r
   UINT8                 Length;\r
@@ -2025,7 +2018,7 @@ S3BootScriptCalculateInsertAddress (
    // calculate the Position offset\r
    //\r
    if (Position != NULL) {\r
-     PositionOffset = (UINTN) ((UINT8 *)Position - S3TableBase);\r
+     PositionOffset = (UINTN)Position - (UINTN)S3TableBase;\r
 \r
      //\r
      // If the BeforeOrAfter is FALSE, that means to insert the node right after the node.\r