]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg PiDxeS3BootScriptLib: Remove the trailing white spaces
authorStar Zeng <star.zeng@intel.com>
Wed, 17 Aug 2016 08:51:55 +0000 (16:51 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 5 Sep 2016 10:15:46 +0000 (18:15 +0800)
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h
MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.uni
MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h

index 45dd581b085d24df169660ffeda06bf357a702c4..9e63273bc19c4f2a2974a1bdd0e42dda28edcba5 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Interpret and execute the S3 data in S3 boot script. \r
+  Interpret and execute the S3 data in S3 boot script.\r
 \r
   Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
@@ -23,7 +23,7 @@
   Management Bus (SMBus) Specification. The resulting transaction will be either that the SMBus\r
   slave devices accept this transaction or that this function returns with error.\r
 \r
-  @param  SmbusAddress            Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, \r
+  @param  SmbusAddress            Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length,\r
                                   and PEC.\r
   @param  Operation               Signifies which particular SMBus hardware protocol instance that\r
                                   it will use to execute the SMBus transactions. This SMBus\r
@@ -120,7 +120,7 @@ SmbusExecute (
       return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  return Status;  \r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -130,7 +130,7 @@ SmbusExecute (
   @param Width          Width of the operation.\r
   @param Address        Address of the operation.\r
   @param AddressStride  Instride for stepping input buffer.\r
-  @param BufferStride   Outstride for stepping output buffer.  \r
+  @param BufferStride   Outstride for stepping output buffer.\r
 \r
   @retval EFI_SUCCESS  Successful translation.\r
   @retval EFI_INVALID_PARAMETER Width or Address is invalid.\r
@@ -170,18 +170,18 @@ BuildLoopData (
 \r
 /**\r
   Perform IO read operation\r
-  \r
+\r
   @param[in]  Width   Width of the operation.\r
   @param[in]  Address Address of the operation.\r
   @param[in]  Count   Count of the number of accesses to perform.\r
-  @param[out] Buffer  Pointer to the buffer to read from I/O space.  \r
+  @param[out] Buffer  Pointer to the buffer to read from I/O space.\r
 \r
   @retval EFI_SUCCESS The data was written to the EFI System.\r
   @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
                                 Buffer is NULL.\r
                                 The Buffer is not aligned for the given Width.\r
-                                Address is outside the legal range of I/O ports.  \r
-                                \r
+                                Address is outside the legal range of I/O ports.\r
+\r
 **/\r
 EFI_STATUS\r
 ScriptIoRead (\r
@@ -274,18 +274,18 @@ ScriptIoRead (
 \r
 /**\r
   Perform IO write operation\r
-  \r
+\r
   @param[in]  Width Width of the operation.\r
   @param[in]  Address Address of the operation.\r
   @param[in]  Count Count of the number of accesses to perform.\r
-  @param[in]  Buffer Pointer to the buffer to write to I/O space.  \r
+  @param[in]  Buffer Pointer to the buffer to write to I/O space.\r
 \r
   @retval EFI_SUCCESS The data was written to the EFI System.\r
   @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
                                 Buffer is NULL.\r
                                 The Buffer is not aligned for the given Width.\r
-                                Address is outside the legal range of I/O ports.  \r
-                                \r
+                                Address is outside the legal range of I/O ports.\r
+\r
 **/\r
 EFI_STATUS\r
 ScriptIoWrite (\r
@@ -322,11 +322,11 @@ ScriptIoWrite (
       case S3BootScriptWidthUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));\r
         IoWrite8 ((UINTN) Address, *In.Uint8);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));\r
         IoWrite8 ((UINTN) OriginalAddress, *In.Uint8);\r
-        break;       \r
+        break;\r
       case S3BootScriptWidthFillUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));\r
         IoWrite8 ((UINTN) Address, *OriginalIn.Uint8);\r
@@ -334,11 +334,11 @@ ScriptIoWrite (
       case S3BootScriptWidthUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));\r
         IoWrite16 ((UINTN) Address, *In.Uint16);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));\r
         IoWrite16 ((UINTN) OriginalAddress, *In.Uint16);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));\r
         IoWrite16 ((UINTN) Address, *OriginalIn.Uint16);\r
@@ -346,7 +346,7 @@ ScriptIoWrite (
       case S3BootScriptWidthUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));\r
         IoWrite32 ((UINTN) Address, *In.Uint32);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));\r
         IoWrite32 ((UINTN) OriginalAddress, *In.Uint32);\r
@@ -358,11 +358,11 @@ ScriptIoWrite (
       case S3BootScriptWidthUint64:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
         IoWrite64 ((UINTN) Address, *In.Uint64);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint64:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));\r
         IoWrite64 ((UINTN) OriginalAddress, *In.Uint64);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint64:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));\r
         IoWrite64 ((UINTN) Address, *OriginalIn.Uint64);\r
@@ -371,25 +371,25 @@ ScriptIoWrite (
         return EFI_INVALID_PARAMETER;\r
     }\r
   }\r
-  \r
+\r
 \r
   return EFI_SUCCESS;\r
 }\r
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_IO_WRITE OP code.\r
-  \r
+\r
   @param Script       Pointer to the node which is to be interpreted.\r
 \r
   @retval EFI_SUCCESS The data was written to the EFI System.\r
   @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
                                 Buffer is NULL.\r
                                 The Buffer is not aligned for the given Width.\r
-                                Address is outside the legal range of I/O ports.  \r
-                                \r
+                                Address is outside the legal range of I/O ports.\r
+\r
 **/\r
 EFI_STATUS\r
 BootScriptExecuteIoWrite (\r
-  IN UINT8                    *Script    \r
+  IN UINT8                    *Script\r
   )\r
 {\r
   S3_BOOT_SCRIPT_LIB_WIDTH   Width;\r
@@ -397,7 +397,7 @@ BootScriptExecuteIoWrite (
   UINTN                      Count;\r
   VOID                      *Buffer;\r
   EFI_BOOT_SCRIPT_IO_WRITE   IoWrite;\r
-  \r
+\r
   CopyMem ((VOID*)&IoWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_WRITE));\r
   Width = (S3_BOOT_SCRIPT_LIB_WIDTH) IoWrite.Width;\r
   Address = IoWrite.Address;\r
@@ -409,19 +409,19 @@ BootScriptExecuteIoWrite (
 }\r
 /**\r
   Perform memory read operation\r
-  \r
+\r
   @param  Width Width of the operation.\r
   @param  Address Address of the operation.\r
   @param  Count Count of the number of accesses to perform.\r
-  @param  Buffer Pointer to the buffer read from memory.  \r
+  @param  Buffer Pointer to the buffer read from memory.\r
 \r
   @retval EFI_SUCCESS The data was written to the EFI System.\r
   @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
                                 Buffer is NULL.\r
                                 The Buffer is not aligned for the given Width.\r
-  @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count \r
-                          is not valid for this EFI System.  \r
-                                \r
+  @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count\r
+                          is not valid for this EFI System.\r
+\r
 **/\r
 EFI_STATUS\r
 ScriptMemoryRead (\r
@@ -508,19 +508,19 @@ ScriptMemoryRead (
 }\r
 /**\r
   Perform memory write operation\r
-  \r
+\r
   @param   Width   Width of the operation.\r
   @param   Address Address of the operation.\r
   @param   Count   Count of the number of accesses to perform.\r
-  @param   Buffer  Pointer to the buffer write to memory.      \r
+  @param   Buffer  Pointer to the buffer write to memory.\r
 \r
   @retval EFI_SUCCESS The data was written to the EFI System.\r
   @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
                                 Buffer is NULL.\r
                                 The Buffer is not aligned for the given Width.\r
-  @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count \r
-                          is not valid for this EFI System.  \r
-                                \r
+  @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count\r
+                          is not valid for this EFI System.\r
+\r
 **/\r
 EFI_STATUS\r
 ScriptMemoryWrite (\r
@@ -532,7 +532,7 @@ ScriptMemoryWrite (
 {\r
   EFI_STATUS  Status;\r
   UINTN       AddressStride;\r
-  UINT64      OriginalAddress;  \r
+  UINT64      OriginalAddress;\r
   UINTN       BufferStride;\r
   PTR         In;\r
   PTR         OriginalIn;\r
@@ -547,17 +547,17 @@ ScriptMemoryWrite (
   // Loop for each iteration and move the data\r
   //\r
   OriginalAddress = Address;\r
-  OriginalIn.Buf = In.Buf;  \r
+  OriginalIn.Buf = In.Buf;\r
   for (; Count > 0; Count--, Address += AddressStride, In.Buf += BufferStride) {\r
     switch (Width) {\r
       case S3BootScriptWidthUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));\r
         MmioWrite8 ((UINTN) Address, *In.Uint8);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint8));\r
         MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));\r
         MmioWrite8 ((UINTN) Address, *OriginalIn.Uint8);\r
@@ -565,11 +565,11 @@ ScriptMemoryWrite (
       case S3BootScriptWidthUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));\r
         MmioWrite16 ((UINTN) Address, *In.Uint16);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint16));\r
         MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));\r
         MmioWrite16 ((UINTN) Address, *OriginalIn.Uint16);\r
@@ -577,11 +577,11 @@ ScriptMemoryWrite (
       case S3BootScriptWidthUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));\r
         MmioWrite32 ((UINTN) Address, *In.Uint32);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", (UINTN)OriginalAddress, (UINTN)*In.Uint32));\r
         MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));\r
         MmioWrite32 ((UINTN) Address, *OriginalIn.Uint32);\r
@@ -589,11 +589,11 @@ ScriptMemoryWrite (
       case S3BootScriptWidthUint64:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
         MmioWrite64 ((UINTN) Address, *In.Uint64);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint64:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));\r
         MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint64:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));\r
         MmioWrite64 ((UINTN) Address, *OriginalIn.Uint64);\r
@@ -608,14 +608,14 @@ ScriptMemoryWrite (
   Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_WRITE OP code.\r
 \r
   @param[in]  Script Pointer to the node which is to be interpreted.\r
-  \r
+\r
   @retval EFI_SUCCESS The data was written to the EFI System.\r
   @retval EFI_INVALID_PARAMETER Width is invalid for this EFI System.\r
                                 Buffer is NULL.\r
                                 The Buffer is not aligned for the given Width.\r
-  @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count \r
-                          is not valid for this EFI System.  \r
-                                \r
+  @retval EFI_UNSUPPORTED The address range specified by Address, Width, and Count\r
+                          is not valid for this EFI System.\r
+\r
 **/\r
 EFI_STATUS\r
 BootScriptExecuteMemoryWrite (\r
@@ -627,7 +627,7 @@ BootScriptExecuteMemoryWrite (
   UINT64           Address;\r
   UINTN            Count;\r
   EFI_BOOT_SCRIPT_MEM_WRITE  MemWrite;\r
-  \r
+\r
   CopyMem((VOID*)&MemWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE));\r
   Width   = (S3_BOOT_SCRIPT_LIB_WIDTH)MemWrite.Width;\r
   Address = MemWrite.Address;\r
@@ -636,8 +636,8 @@ BootScriptExecuteMemoryWrite (
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryWrite - 0x%08x, 0x%08x, 0x%08x\n", (UINTN)Address, Count, (UINTN)Width));\r
   return ScriptMemoryWrite (Width,Address, Count,  Buffer);\r
-  \r
-}  \r
+\r
+}\r
 /**\r
   Performance PCI configuration read operation\r
 \r
@@ -645,9 +645,9 @@ BootScriptExecuteMemoryWrite (
   @param  Address Address of the operation.\r
   @param  Count   Count of the number of accesses to perform.\r
   @param  Buffer  Pointer to the buffer read from PCI config space\r
-  \r
+\r
   @retval EFI_SUCCESS The read succeed.\r
-  @retval EFI_INVALID_PARAMETER if Width is not defined  \r
+  @retval EFI_INVALID_PARAMETER if Width is not defined\r
   @note  A known Limitations in the implementation which is 64bits operations are not supported.\r
 \r
 **/\r
@@ -731,9 +731,9 @@ ScriptPciCfgRead (
   @param  Address Address of the operation.\r
   @param  Count   Count of the number of accesses to perform.\r
   @param  Buffer  Pointer to the buffer write to PCI config space\r
-  \r
+\r
   @retval EFI_SUCCESS The write succeed.\r
-  @retval EFI_INVALID_PARAMETER if Width is not defined  \r
+  @retval EFI_INVALID_PARAMETER if Width is not defined\r
   @note  A known Limitations in the implementation which is 64bits operations are not supported.\r
 \r
 **/\r
@@ -771,11 +771,11 @@ ScriptPciCfgWrite (
       case S3BootScriptWidthUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*In.Uint8));\r
         PciWrite8 (PciAddress, *In.Uint8);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint8 - 0x%08x (0x%02x)\n", OriginalPciAddress, (UINTN)*In.Uint8));\r
         PciWrite8 (OriginalPciAddress, *In.Uint8);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint8:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", PciAddress, (UINTN)*OriginalIn.Uint8));\r
         PciWrite8 (PciAddress, *OriginalIn.Uint8);\r
@@ -783,11 +783,11 @@ ScriptPciCfgWrite (
       case S3BootScriptWidthUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*In.Uint16));\r
         PciWrite16 (PciAddress, *In.Uint16);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint16 - 0x%08x (0x%04x)\n", OriginalPciAddress, (UINTN)*In.Uint16));\r
         PciWrite16 (OriginalPciAddress, *In.Uint16);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint16:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", PciAddress, (UINTN)*OriginalIn.Uint16));\r
         PciWrite16 (PciAddress, *OriginalIn.Uint16);\r
@@ -795,11 +795,11 @@ ScriptPciCfgWrite (
       case S3BootScriptWidthUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthUint32 - 0x%08x (0x%08x)\n", PciAddress, (UINTN)*In.Uint32));\r
         PciWrite32 (PciAddress, *In.Uint32);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFifoUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint32 - 0x%08x (0x%08x)\n", OriginalPciAddress, (UINTN)*In.Uint32));\r
         PciWrite32 (OriginalPciAddress, *In.Uint32);\r
-        break;      \r
+        break;\r
       case S3BootScriptWidthFillUint32:\r
         DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)PciAddress, (UINTN)*OriginalIn.Uint32));\r
         PciWrite32 (PciAddress, *OriginalIn.Uint32);\r
@@ -812,7 +812,7 @@ ScriptPciCfgWrite (
 }\r
 /**\r
   Performance PCI configuration 2 read operation\r
-  \r
+\r
   @param     Width                      Width of the operation.\r
   @param     Segment                    Pci segment number\r
   @param     Address                    Address of the operation.\r
@@ -824,25 +824,25 @@ ScriptPciCfgWrite (
                                         Buffer is NULL.\r
                                         The Buffer is not aligned for the given Width.\r
                                         Address is outside the legal range of I/O ports.\r
-  @note  A known Limitations in the implementation which is the 'Segment' parameter is assumed as \r
+  @note  A known Limitations in the implementation which is the 'Segment' parameter is assumed as\r
          Zero, or else, assert.\r
 **/\r
 EFI_STATUS\r
 ScriptPciCfg2Read (\r
   IN  S3_BOOT_SCRIPT_LIB_WIDTH    Width,\r
-  IN  UINT16                   Segment,  \r
+  IN  UINT16                   Segment,\r
   IN  UINT64                   Address,\r
   IN  UINTN                    Count,\r
   OUT VOID                     *Buffer\r
   )\r
 {\r
   ASSERT (Segment==0);\r
-  \r
+\r
   return ScriptPciCfgRead (Width, Address, Count, Buffer);\r
 }\r
 /**\r
   Performance PCI configuration 2 write operation\r
-  \r
+\r
   @param     Width                      Width of the operation.\r
   @param     Segment                    Pci segment number\r
   @param     Address                    Address of the operation.\r
@@ -854,15 +854,15 @@ ScriptPciCfg2Read (
                                         Buffer is NULL.\r
                                         The Buffer is not aligned for the given Width.\r
                                         Address is outside the legal range of I/O ports.\r
-  @note  A known Limitations in the implementation which is the 'Segment' parameter is assumed as \r
+  @note  A known Limitations in the implementation which is the 'Segment' parameter is assumed as\r
          Zero, or else, assert.\r
-                                \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 ScriptPciCfg2Write (\r
   IN  S3_BOOT_SCRIPT_LIB_WIDTH    Width,\r
-  IN  UINT16                   Segment,  \r
+  IN  UINT16                   Segment,\r
   IN  UINT64                   Address,\r
   IN  UINTN                    Count,\r
   IN  VOID                     *Buffer\r
@@ -873,9 +873,9 @@ ScriptPciCfg2Write (
 }\r
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE OP code.\r
-  \r
-  @param  Script        The pointer of typed node in boot script table \r
-  \r
+\r
+  @param  Script        The pointer of typed node in boot script table\r
+\r
   @retval EFI_SUCCESS  The operation was executed successfully\r
 **/\r
 EFI_STATUS\r
@@ -902,7 +902,7 @@ BootScriptExecutePciCfgWrite (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_IO_READ_WRITE OP code.\r
 \r
-  @param Script   The pointer of typed node in boot script table \r
+  @param Script   The pointer of typed node in boot script table\r
   @param AndMask  Mask value for 'and' operation\r
   @param OrMask   Mask value for 'or' operation\r
 \r
@@ -919,9 +919,9 @@ BootScriptExecuteIoReadWrite (
   EFI_STATUS  Status;\r
   UINT64      Data;\r
   EFI_BOOT_SCRIPT_IO_READ_WRITE IoReadWrite;\r
-  \r
+\r
   Data = 0;\r
-  \r
+\r
   CopyMem((VOID*)&IoReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteIoReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)IoReadWrite.Address, AndMask, OrMask));\r
@@ -946,7 +946,7 @@ BootScriptExecuteIoReadWrite (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_READ_WRITE OP code.\r
 \r
-  @param Script    The pointer of typed node in boot script table \r
+  @param Script    The pointer of typed node in boot script table\r
   @param AndMask   Mask value for 'and' operation\r
   @param OrMask    Mask value for 'or' operation\r
 \r
@@ -963,13 +963,13 @@ BootScriptExecuteMemoryReadWrite (
   EFI_STATUS  Status;\r
   UINT64      Data;\r
   EFI_BOOT_SCRIPT_MEM_READ_WRITE  MemReadWrite;\r
-  \r
+\r
   Data = 0;\r
-  \r
+\r
   CopyMem((VOID*)&MemReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_READ_WRITE));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteMemoryReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemReadWrite.Address, AndMask, OrMask));\r
-  \r
+\r
   Status = ScriptMemoryRead (\r
              (S3_BOOT_SCRIPT_LIB_WIDTH) MemReadWrite.Width,\r
              MemReadWrite.Address,\r
@@ -990,7 +990,7 @@ BootScriptExecuteMemoryReadWrite (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CFG_READ_WRITE OP code.\r
 \r
-  @param Script   The pointer of typed node in boot script table \r
+  @param Script   The pointer of typed node in boot script table\r
   @param AndMask  Mask value for 'and' operation\r
   @param OrMask   Mask value for 'or' operation\r
 \r
@@ -1013,7 +1013,7 @@ BootScriptExecutePciCfgReadWrite (
   CopyMem((VOID*)&PciCfgReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfgReadWrite - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgReadWrite.Address), AndMask, OrMask));\r
-  \r
+\r
   Status = ScriptPciCfgRead (\r
              (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfgReadWrite.Width,\r
              PciCfgReadWrite.Address,\r
@@ -1038,11 +1038,11 @@ BootScriptExecutePciCfgReadWrite (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_SMBUS_EXECUTE OP code.\r
 \r
-  @param Script  The pointer of typed node in boot script table \r
\r
+  @param Script  The pointer of typed node in boot script table\r
+\r
   @retval EFI_SUCCESS      The operation was executed successfully\r
   @retval EFI_UNSUPPORTED  Cannot locate smbus ppi or occur error of script execution\r
-  @retval Others           Result of script execution \r
+  @retval Others           Result of script execution\r
 **/\r
 EFI_STATUS\r
 BootScriptExecuteSmbusExecute (\r
@@ -1052,7 +1052,7 @@ BootScriptExecuteSmbusExecute (
   UINTN                    SmBusAddress;\r
   UINTN                    DataSize;\r
   EFI_BOOT_SCRIPT_SMBUS_EXECUTE SmbusExecuteEntry;\r
-  \r
+\r
   CopyMem ((VOID*)&SmbusExecuteEntry, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_SMBUS_EXECUTE ));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteSmbusExecute - 0x%08x, 0x%08x\n", (UINTN)SmbusExecuteEntry.SmBusAddress, (UINTN)SmbusExecuteEntry.Operation));\r
@@ -1069,8 +1069,8 @@ BootScriptExecuteSmbusExecute (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_STALL OP code.\r
 \r
-  @param Script      The pointer of typed node in boot script table \r
-  \r
+  @param Script      The pointer of typed node in boot script table\r
+\r
   @retval EFI_SUCCESS The operation was executed successfully\r
 **/\r
 EFI_STATUS\r
@@ -1079,7 +1079,7 @@ BootScriptExecuteStall (
   )\r
 {\r
   EFI_BOOT_SCRIPT_STALL    Stall;\r
-  \r
+\r
   CopyMem ((VOID*)&Stall, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_STALL));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteStall - 0x%08x\n", (UINTN)Stall.Duration));\r
@@ -1089,8 +1089,8 @@ BootScriptExecuteStall (
 }\r
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH OP code.\r
-  \r
-  @param Script  The pointer of typed node in boot script table \r
+\r
+  @param Script  The pointer of typed node in boot script table\r
   @retval EFI_SUCCESS  The operation was executed successfully\r
 **/\r
 EFI_STATUS\r
@@ -1101,7 +1101,7 @@ BootScriptExecuteDispatch (
   EFI_STATUS                Status;\r
   DISPATCH_ENTRYPOINT_FUNC  EntryFunc;\r
   EFI_BOOT_SCRIPT_DISPATCH  ScriptDispatch;\r
-  \r
+\r
   CopyMem ((VOID*)&ScriptDispatch, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH));\r
   EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch.EntryPoint);\r
 \r
@@ -1114,7 +1114,7 @@ BootScriptExecuteDispatch (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_DISPATCH_2 OP code.\r
 \r
-  @param  Script       The pointer of typed node in boot script table \r
+  @param  Script       The pointer of typed node in boot script table\r
   @retval EFI_SUCCESS  The operation was executed successfully\r
 **/\r
 EFI_STATUS\r
@@ -1125,11 +1125,11 @@ BootScriptExecuteDispatch2 (
   EFI_STATUS                Status;\r
   DISPATCH_ENTRYPOINT_FUNC  EntryFunc;\r
   EFI_BOOT_SCRIPT_DISPATCH_2  ScriptDispatch2;\r
-  \r
+\r
   CopyMem ((VOID*)&ScriptDispatch2, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_DISPATCH_2));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteDispatch2 - 0x%08x(0x%08x)\n", (UINTN)ScriptDispatch2.EntryPoint, (UINTN)ScriptDispatch2.Context));\r
-  \r
+\r
   EntryFunc = (DISPATCH_ENTRYPOINT_FUNC) (UINTN) (ScriptDispatch2.EntryPoint);\r
 \r
   Status    = EntryFunc (NULL, (VOID *) (UINTN) ScriptDispatch2.Context);\r
@@ -1139,11 +1139,11 @@ BootScriptExecuteDispatch2 (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_MEM_POLL OP code.\r
 \r
-  @param  Script  The pointer of typed node in boot script table \r
+  @param  Script  The pointer of typed node in boot script table\r
   @param  AndMask  Mask value for 'and' operation\r
   @param  OrMask   Mask value for 'or' operation\r
-  \r
-  @retval EFI_DEVICE_ERROR Data polled from memory does not equal to \r
+\r
+  @retval EFI_DEVICE_ERROR Data polled from memory does not equal to\r
                            the epecting data within the Loop Times.\r
   @retval EFI_SUCCESS      The operation was executed successfully\r
 **/\r
@@ -1151,15 +1151,15 @@ EFI_STATUS
 BootScriptExecuteMemPoll (\r
   IN UINT8                        *Script,\r
   IN UINT64                        AndMask,\r
-  IN UINT64                        OrMask  \r
+  IN UINT64                        OrMask\r
   )\r
 {\r
-  \r
+\r
   UINT64        Data;\r
   UINT64        LoopTimes;\r
   EFI_STATUS    Status;\r
   EFI_BOOT_SCRIPT_MEM_POLL       MemPoll;\r
-  \r
+\r
   CopyMem ((VOID*)&MemPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_MEM_POLL));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteMemPoll - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)MemPoll.Address, AndMask, OrMask));\r
@@ -1200,8 +1200,8 @@ BootScriptExecuteMemPoll (
   Execute the boot script to interpret the Store arbitrary information.\r
   This opcode is a no-op on dispatch and is only used for debugging script issues.\r
 \r
-  @param Script       The pointer of node in boot script table \r
\r
+  @param Script       The pointer of node in boot script table\r
+\r
 **/\r
 VOID\r
 BootScriptExecuteInformation (\r
@@ -1226,10 +1226,10 @@ BootScriptExecuteInformation (
 }\r
 \r
 /**\r
-  Execute the boot script to interpret the Label information. \r
+  Execute the boot script to interpret the Label information.\r
+\r
+  @param Script       The pointer of node in boot script table\r
 \r
-  @param Script       The pointer of node in boot script table \r
\r
 **/\r
 VOID\r
 BootScriptExecuteLabel (\r
@@ -1255,7 +1255,7 @@ BootScriptExecuteLabel (
 \r
 /**\r
   calculate the mask value for 'and' and 'or' operation\r
-  @param ScriptHeader   The pointer of header of node in boot script table \r
+  @param ScriptHeader   The pointer of header of node in boot script table\r
   @param AndMask  The Mask value for 'and' operation\r
   @param OrMask   The Mask value for 'or' operation\r
   @param Script   Pointer to the entry.\r
@@ -1287,27 +1287,27 @@ CheckAndOrMask (
   case EFI_BOOT_SCRIPT_MEM_POLL_OPCODE:\r
     Size = sizeof (EFI_BOOT_SCRIPT_MEM_POLL);\r
     break;\r
-  \r
+\r
   case EFI_BOOT_SCRIPT_IO_POLL_OPCODE:\r
     Size = sizeof (EFI_BOOT_SCRIPT_IO_POLL);\r
-    break;    \r
-  \r
+    break;\r
+\r
   case EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE:\r
     Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE);\r
     break;\r
-  \r
+\r
   case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE:\r
     Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL);\r
     break;\r
-  \r
+\r
   case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE:\r
     Size = sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL);\r
     break;\r
-  \r
+\r
   default:\r
     return;\r
   }\r
-  \r
+\r
   DataPtr = Script + Size;\r
 \r
   switch (ScriptHeader->Width) {\r
@@ -1340,11 +1340,11 @@ CheckAndOrMask (
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_IO_POLL OP code.\r
 \r
-  @param  Script  The pointer of typed node in boot script table \r
+  @param  Script  The pointer of typed node in boot script table\r
   @param  AndMask  Mask value for 'and' operation\r
   @param  OrMask   Mask value for 'or' operation\r
-  \r
-  @retval EFI_DEVICE_ERROR Data polled from memory does not equal to \r
+\r
+  @retval EFI_DEVICE_ERROR Data polled from memory does not equal to\r
                            the epecting data within the Loop Times.\r
   @retval EFI_SUCCESS      The operation was executed successfully\r
 **/\r
@@ -1359,7 +1359,7 @@ BootScriptExecuteIoPoll (
   UINT64        Data;\r
   UINT64        LoopTimes;\r
   EFI_BOOT_SCRIPT_IO_POLL       IoPoll;\r
-  \r
+\r
   CopyMem ((VOID*)&IoPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_IO_POLL));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecuteIoPoll - 0x%08x, 0x%016lx, 0x%016lx\n", (UINTN)IoPoll.Address, AndMask, OrMask));\r
@@ -1385,7 +1385,7 @@ BootScriptExecuteIoPoll (
                );\r
     if ((!EFI_ERROR (Status)) &&(Data & AndMask) == OrMask) {\r
       return EFI_SUCCESS;\r
-    } \r
+    }\r
   }\r
 \r
   if (LoopTimes < IoPoll.Delay) {\r
@@ -1413,7 +1413,7 @@ BootScriptExecutePciCfg2Write (
   UINT64                            Address;\r
   UINTN                             Count;\r
   EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE PciCfg2Write;\r
-  \r
+\r
   CopyMem ((VOID*)&PciCfg2Write, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE));\r
 \r
   Width   = (S3_BOOT_SCRIPT_LIB_WIDTH)PciCfg2Write.Width;\r
@@ -1429,7 +1429,7 @@ BootScriptExecutePciCfg2Write (
 \r
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE OP code.\r
-  \r
+\r
   @param     Script                     The pointer of S3 boot script\r
   @param     AndMask                    Mask value for 'and' operation\r
   @param     OrMask                     Mask value for 'or' operation\r
@@ -1453,7 +1453,7 @@ BootScriptExecutePciCfg2ReadWrite (
   CopyMem ((VOID*)&PciCfg2ReadWrite, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptExecutePciCfg2ReadWrite - 0x%04x, 0x%08x, 0x%016lx, 0x%016lx\n", PciCfg2ReadWrite.Segment, PCI_ADDRESS_ENCODE (PciCfg2ReadWrite.Address), AndMask, OrMask));\r
-  \r
+\r
   Status = ScriptPciCfg2Read (\r
              (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2ReadWrite.Width,\r
              PciCfg2ReadWrite.Segment,\r
@@ -1477,20 +1477,20 @@ BootScriptExecutePciCfg2ReadWrite (
 }\r
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG_POLL OP code.\r
-  \r
+\r
   @param     Script                     The pointer of S3 boot script\r
   @param     AndMask                    Mask value for 'and' operation\r
   @param     OrMask                     Mask value for 'or' operation\r
 \r
   @retval    EFI_SUCCESS                The operation was executed successfully\r
-  @retval    EFI_DEVICE_ERROR           Data polled from Pci configuration space does not equal to \r
+  @retval    EFI_DEVICE_ERROR           Data polled from Pci configuration space does not equal to\r
                                         epecting data within the Loop Times.\r
 **/\r
 EFI_STATUS\r
 BootScriptPciCfgPoll (\r
   IN UINT8                         *Script,\r
   IN UINT64                        AndMask,\r
-  IN UINT64                        OrMask  \r
+  IN UINT64                        OrMask\r
   )\r
 {\r
   UINT64        Data;\r
@@ -1500,7 +1500,7 @@ BootScriptPciCfgPoll (
   CopyMem ((VOID*)&PciCfgPoll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG_POLL));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptPciCfgPoll - 0x%08x, 0x%016lx, 0x%016lx\n", PCI_ADDRESS_ENCODE (PciCfgPoll.Address), AndMask, OrMask));\r
-  \r
+\r
   Data = 0;\r
   Status = ScriptPciCfgRead (\r
              (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfgPoll.Width,\r
@@ -1536,13 +1536,13 @@ BootScriptPciCfgPoll (
 \r
 /**\r
   Interprete the boot script node with EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL OP code.\r
-  \r
+\r
   @param     Script                     The pointer of S3 Boot Script\r
   @param     AndMask                    Mask value for 'and' operation\r
   @param     OrMask                     Mask value for 'or' operation\r
 \r
   @retval    EFI_SUCCESS                The operation was executed successfully\r
-  @retval    EFI_DEVICE_ERROR           Data polled from Pci configuration space does not equal to \r
+  @retval    EFI_DEVICE_ERROR           Data polled from Pci configuration space does not equal to\r
                                         epecting data within the Loop Times.\r
 \r
 **/\r
@@ -1550,7 +1550,7 @@ EFI_STATUS
 BootScriptPciCfg2Poll (\r
   IN UINT8                        *Script,\r
   IN UINT64                        AndMask,\r
-  IN UINT64                        OrMask  \r
+  IN UINT64                        OrMask\r
   )\r
 {\r
   EFI_STATUS    Status;\r
@@ -1562,7 +1562,7 @@ BootScriptPciCfg2Poll (
   CopyMem ((VOID*)&PciCfg2Poll, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL));\r
 \r
   DEBUG ((EFI_D_INFO, "BootScriptPciCfg2Poll - 0x%04x, 0x%08x, 0x%016lx, 0x%016lx\n", PciCfg2Poll.Segment, PCI_ADDRESS_ENCODE (PciCfg2Poll.Address), AndMask, OrMask));\r
\r
+\r
   Status = ScriptPciCfg2Read (\r
              (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width,\r
              PciCfg2Poll.Segment,\r
@@ -1580,7 +1580,7 @@ BootScriptPciCfg2Poll (
     Data = 0;\r
     Status = ScriptPciCfg2Read (\r
                (S3_BOOT_SCRIPT_LIB_WIDTH) PciCfg2Poll.Width,\r
-               PciCfg2Poll.Segment,               \r
+               PciCfg2Poll.Segment,\r
                PciCfg2Poll.Address,\r
                1,\r
                &Data\r
@@ -1595,17 +1595,17 @@ BootScriptPciCfg2Poll (
   } else {\r
     return EFI_DEVICE_ERROR;\r
   }\r
-  \r
+\r
 }\r
 \r
 /**\r
   Executes the S3 boot script table.\r
\r
+\r
   @retval RETURN_SUCCESS           The boot script table was executed successfully.\r
-  @retval RETURN_UNSUPPORTED       Invalid script table or opcode.  \r
-  \r
+  @retval RETURN_UNSUPPORTED       Invalid script table or opcode.\r
+\r
   @note  A known Limitations in the implementation: When interpreting the opcode  EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE\r
-         EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as \r
+         EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as\r
          Zero, or else, assert.\r
 **/\r
 RETURN_STATUS\r
@@ -1623,7 +1623,7 @@ S3BootScriptExecute (
   EFI_BOOT_SCRIPT_COMMON_HEADER  ScriptHeader;\r
   EFI_BOOT_SCRIPT_TABLE_HEADER   TableHeader;\r
   Script = mS3BootScriptTablePtr->TableBase;\r
-  if (Script != 0) {    \r
+  if (Script != 0) {\r
     CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));\r
   } else {\r
     return EFI_INVALID_PARAMETER;\r
@@ -1635,7 +1635,7 @@ S3BootScriptExecute (
   }\r
 \r
   DEBUG ((EFI_D_INFO, "TableHeader - 0x%08x\n", Script));\r
-  \r
+\r
   StartAddress  = (UINTN) Script;\r
   TableLength   = TableHeader.TableLength;\r
   Script    =    Script + TableHeader.Length;\r
@@ -1648,7 +1648,7 @@ S3BootScriptExecute (
 \r
   while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {\r
     DEBUG ((EFI_D_INFO, "ExecuteBootScript - %08x\n", (UINTN)Script));\r
-    \r
+\r
     CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));\r
     switch (ScriptHeader.OpCode) {\r
 \r
@@ -1713,7 +1713,7 @@ S3BootScriptExecute (
     case EFI_BOOT_SCRIPT_INFORMATION_OPCODE:\r
       DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_INFORMATION_OPCODE\n"));\r
       BootScriptExecuteInformation (Script);\r
-      break;    \r
+      break;\r
 \r
     case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE:\r
       DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE\n"));\r
@@ -1744,21 +1744,21 @@ S3BootScriptExecute (
       DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_MEM_POLL_OPCODE\n"));\r
       CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
       Status = BootScriptExecuteMemPoll (Script, AndMask, OrMask);\r
-      \r
+\r
       break;\r
-    \r
+\r
     case EFI_BOOT_SCRIPT_IO_POLL_OPCODE:\r
       DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_IO_POLL_OPCODE\n"));\r
       CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
       Status = BootScriptExecuteIoPoll (Script, AndMask, OrMask);\r
       break;\r
-      \r
+\r
     case EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE:\r
       DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE\n"));\r
       CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
       Status = BootScriptPciCfgPoll (Script, AndMask, OrMask);\r
       break;\r
-      \r
+\r
     case EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE:\r
      DEBUG ((EFI_D_INFO, "EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE\n"));\r
      CheckAndOrMask (&ScriptHeader, &AndMask, &OrMask, Script);\r
index 99cb407dbd33d304a8430f5668f55de82bbc9625..38171c56fdb6c2757d671ae60ced691b4605193d 100644 (file)
@@ -169,7 +169,7 @@ typedef struct {
   UINT8   Length;\r
   UINT32  Width;\r
   UINT64  Address;\r
-  UINT16  Segment;  \r
+  UINT16  Segment;\r
   UINT64  Delay;\r
 } EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL;\r
 \r
index 0459bae4c60adc5c666919384508a7a772756a74..de3915511cec1f3ee93be650bc4332958de767eb 100644 (file)
@@ -133,10 +133,10 @@ BOOLEAN                          mS3BootScriptTableSmmAllocated = FALSE;
 EFI_SMM_SYSTEM_TABLE2            *mBootScriptSmst = NULL;\r
 \r
 /**\r
-  This is an internal function to add a terminate node the entry, recalculate the table \r
-  length and fill into the table. \r
-  \r
-  @return the base address of the boot script table.   \r
+  This is an internal function to add a terminate node the entry, recalculate the table\r
+  length and fill into the table.\r
+\r
+  @return the base address of the boot script table.\r
  **/\r
 UINT8*\r
 S3BootScriptInternalCloseTable (\r
@@ -147,7 +147,7 @@ S3BootScriptInternalCloseTable (
   EFI_BOOT_SCRIPT_TERMINATE      ScriptTerminate;\r
   EFI_BOOT_SCRIPT_TABLE_HEADER   *ScriptTableInfo;\r
   S3TableBase = mS3BootScriptTablePtr->TableBase;\r
-  \r
+\r
   if (S3TableBase == NULL) {\r
     //\r
     // the table is not exist\r
@@ -165,17 +165,17 @@ S3BootScriptInternalCloseTable (
   //\r
   ScriptTableInfo                = (EFI_BOOT_SCRIPT_TABLE_HEADER*)(mS3BootScriptTablePtr->TableBase);\r
   ScriptTableInfo->TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE);\r
-  \r
\r
-  \r
+\r
+\r
+\r
   return S3TableBase;\r
   //\r
-  // NOTE: Here we did NOT adjust the mS3BootScriptTablePtr->TableLength to \r
+  // NOTE: Here we did NOT adjust the mS3BootScriptTablePtr->TableLength to\r
   // mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE).\r
   // Because maybe after SmmReadyToLock, we still need add entries into the table,\r
   // and the entry should be added start before this TERMINATE node.\r
   //\r
-}  \r
+}\r
 \r
 /**\r
   This function save boot script data to LockBox.\r
@@ -220,9 +220,9 @@ SaveBootScriptDataToLockBox (
 /**\r
   This is the Event call back function to notify the Library the system is entering\r
   SmmLocked phase.\r
-  \r
+\r
   @param  Event   Pointer to this event\r
-  @param  Context Event handler private data \r
+  @param  Context Event handler private data\r
  **/\r
 VOID\r
 EFIAPI\r
@@ -419,8 +419,8 @@ S3BootScriptSmmAtRuntimeCallBack (
 \r
 /**\r
   Library Constructor.\r
-  this function just identify it is a smm driver or non-smm driver linked against \r
-  with the library   \r
+  this function just identify it is a smm driver or non-smm driver linked against\r
+  with the library\r
 \r
   @param  ImageHandle   The firmware allocated handle for the EFI image.\r
   @param  SystemTable   A pointer to the EFI System Table.\r
@@ -637,12 +637,12 @@ S3BootScriptLibDeinitialize (
 /**\r
   To get the start address from which a new boot time s3 boot script entry will write into.\r
   If the table is not exist, the functio will first allocate a buffer for the table\r
-  If the table buffer is not enough for the new entry, in non-smm mode, the funtion will \r
+  If the table buffer is not enough for the new entry, in non-smm mode, the funtion will\r
   invoke reallocate to enlarge buffer.\r
-  \r
+\r
   @param EntryLength      the new entry length.\r
-  \r
-  @retval the address from which the a new s3 boot script entry will write into \r
+\r
+  @retval the address from which the a new s3 boot script entry will write into\r
  **/\r
 UINT8*\r
 S3BootScriptGetBootTimeEntryAddAddress (\r
@@ -656,11 +656,11 @@ S3BootScriptGetBootTimeEntryAddAddress (
    UINT16                            PageNumber;\r
    EFI_STATUS                        Status;\r
    EFI_BOOT_SCRIPT_TABLE_HEADER      *ScriptTableInfo;\r
-   \r
+\r
    S3TableBase = (EFI_PHYSICAL_ADDRESS)(UINTN)(mS3BootScriptTablePtr->TableBase);\r
    if (S3TableBase == 0) {\r
      //\r
-     // The table is not exist. This is the first to add entry. \r
+     // The table is not exist. This is the first to add entry.\r
      // Allocate ACPI script table space under 4G memory.\r
      //\r
      S3TableBase = 0xffffffff;\r
@@ -670,7 +670,7 @@ S3BootScriptGetBootTimeEntryAddAddress (
                   2 + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber),\r
                   (EFI_PHYSICAL_ADDRESS*)&S3TableBase\r
                   );\r
-     \r
+\r
      if (EFI_ERROR(Status)) {\r
        ASSERT_EFI_ERROR (Status);\r
        return 0;\r
@@ -687,12 +687,12 @@ S3BootScriptGetBootTimeEntryAddAddress (
      mS3BootScriptTablePtr->TableBase = (UINT8*)(UINTN)S3TableBase;\r
      mS3BootScriptTablePtr->TableMemoryPageNumber = (UINT16)(2 + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));\r
    }\r
-     \r
+\r
    // 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
-     // \r
+     //\r
      // The buffer is too small to hold the table, Reallocate the buffer\r
      //\r
      NewS3TableBase = 0xffffffff;\r
@@ -702,43 +702,43 @@ S3BootScriptGetBootTimeEntryAddAddress (
                   2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber),\r
                   (EFI_PHYSICAL_ADDRESS*)&NewS3TableBase\r
                   );\r
-   \r
+\r
      if (EFI_ERROR(Status)) {\r
        ASSERT_EFI_ERROR (Status);\r
        return 0;\r
      }\r
-     \r
+\r
      CopyMem ((VOID*)(UINTN)NewS3TableBase, (VOID*)(UINTN)S3TableBase, TableLength);\r
      gBS->FreePages (S3TableBase, mS3BootScriptTablePtr->TableMemoryPageNumber);\r
-         \r
+\r
      mS3BootScriptTablePtr->TableBase = (UINT8*)(UINTN)NewS3TableBase;\r
-     mS3BootScriptTablePtr->TableMemoryPageNumber =  (UINT16) (2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber)); \r
+     mS3BootScriptTablePtr->TableMemoryPageNumber =  (UINT16) (2 + PageNumber + PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));\r
    }\r
    //\r
-   // calculate the the start address for the new entry. \r
+   // calculate the the start address for the new entry.\r
    //\r
    NewEntryPtr = mS3BootScriptTablePtr->TableBase + TableLength;\r
-   \r
+\r
    //\r
    // update the table lenghth\r
    //\r
    mS3BootScriptTablePtr->TableLength =  TableLength + EntryLength;\r
-   \r
+\r
    //\r
    // In the boot time, we will not append the termination entry to the boot script\r
-   // table until the callers think there is no boot time data that should be added and \r
-   // it is caller's responsibility to explicit call the CloseTable. \r
+   // table until the callers think there is no boot time data that should be added and\r
+   // it is caller's responsibility to explicit call the CloseTable.\r
    //\r
    //\r
-  \r
-   return NewEntryPtr;    \r
+\r
+   return NewEntryPtr;\r
 }\r
 /**\r
   To get the start address from which a new runtime(after SmmReadyToLock) s3 boot script entry will write into.\r
   In this case, it should be ensured that there is enough buffer to hold the entry.\r
-  \r
+\r
   @param EntryLength      the new entry length.\r
-  \r
+\r
   @retval the address from which the a new s3 runtime(after SmmReadyToLock) script entry will write into\r
  **/\r
 UINT8*\r
@@ -747,20 +747,20 @@ S3BootScriptGetRuntimeEntryAddAddress (
   )\r
 {\r
    UINT8     *NewEntryPtr;\r
-   \r
-   NewEntryPtr = NULL;   \r
+\r
+   NewEntryPtr = NULL;\r
    //\r
-   // Check if the memory range reserved for S3 Boot Script table is large enough to hold the node. \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
-     NewEntryPtr = mS3BootScriptTablePtr->TableBase + mS3BootScriptTablePtr->TableLength;   \r
+     NewEntryPtr = mS3BootScriptTablePtr->TableBase + mS3BootScriptTablePtr->TableLength;\r
      mS3BootScriptTablePtr->TableLength = mS3BootScriptTablePtr->TableLength + EntryLength;\r
      //\r
      // Append a terminate node on every insert\r
      //\r
      S3BootScriptInternalCloseTable ();\r
    }\r
-   return (UINT8*)NewEntryPtr;    \r
+   return (UINT8*)NewEntryPtr;\r
 }\r
 \r
 /**\r
@@ -805,12 +805,12 @@ RestoreBootTimeDataFromLockBox (
 \r
 /**\r
   To get the start address from which a new s3 boot script entry will write into.\r
-  \r
+\r
   @param EntryLength      the new entry length.\r
-  \r
-  @retval the address from which the a new s3 boot script entry will write into \r
- **/ \r
-UINT8* \r
+\r
+  @retval the address from which the a new s3 boot script entry will write into\r
+ **/\r
+UINT8*\r
 S3BootScriptGetEntryAddAddress (\r
   UINT8  EntryLength\r
   )\r
@@ -842,10 +842,10 @@ S3BootScriptGetEntryAddAddress (
     NewEntryPtr  = S3BootScriptGetRuntimeEntryAddAddress (EntryLength);\r
   } else {\r
     NewEntryPtr  = S3BootScriptGetBootTimeEntryAddAddress (EntryLength);\r
-  }  \r
+  }\r
   return NewEntryPtr;\r
-  \r
-}  \r
+\r
+}\r
 \r
 /**\r
   Sync BootScript LockBox data.\r
@@ -899,28 +899,28 @@ SyncBootScript (
   ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
-/** \r
-  This is an function to close the S3 boot script table. The function could only be called in \r
-  BOOT time phase. To comply with the Framework spec definition on \r
+/**\r
+  This is an function to close the S3 boot script table. The function could only be called in\r
+  BOOT time phase. To comply with the Framework spec definition on\r
   EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things:\r
   1. Closes the specified boot script table\r
-  2. It allocates a new memory pool to duplicate all the boot scripts in the specified table. \r
-     Once this function is called, the table maintained by the library will be destroyed \r
+  2. It allocates a new memory pool to duplicate all the boot scripts in the specified table.\r
+     Once this function is called, the table maintained by the library will be destroyed\r
      after it is copied into the allocated pool.\r
-  3. Any attempts to add a script record after calling this function will cause a new table \r
+  3. Any attempts to add a script record after calling this function will cause a new table\r
      to be created by the library.\r
-  4. The base address of the allocated pool will be returned in Address. Note that after \r
+  4. The base address of the allocated pool will be returned in Address. Note that after\r
      using the boot script table, the CALLER is responsible for freeing the pool that is allocated\r
-     by this function. \r
+     by this function.\r
 \r
-  In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. To provides this API for now is \r
+  In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. To provides this API for now is\r
   for Framework Spec compatibility.\r
-  \r
-  If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out \r
-  how to get the script to run at S3 resume because the boot script maintained by the lib will be \r
+\r
+  If anyone does call CloseTable() on a real platform, then the caller is responsible for figuring out\r
+  how to get the script to run at S3 resume because the boot script maintained by the lib will be\r
   destroyed.\r
\r
-  @return the base address of the new copy of the boot script table.   \r
+\r
+  @return the base address of the new copy of the boot script table.\r
   @note this function could only called in boot time phase\r
 \r
 **/\r
@@ -935,10 +935,10 @@ S3BootScriptCloseTable (
   UINT8                          *Buffer;\r
   EFI_STATUS                      Status;\r
   EFI_BOOT_SCRIPT_TABLE_HEADER      *ScriptTableInfo;\r
-  \r
-  S3TableBase =    mS3BootScriptTablePtr->TableBase;    \r
+\r
+  S3TableBase =    mS3BootScriptTablePtr->TableBase;\r
   if (S3TableBase == 0) {\r
-    return 0; \r
+    return 0;\r
   }\r
   //\r
   // Append the termination record the S3 boot script table\r
@@ -946,7 +946,7 @@ S3BootScriptCloseTable (
   S3BootScriptInternalCloseTable();\r
   TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE);\r
   //\r
-  // Allocate the buffer and copy the boot script to the buffer. \r
+  // Allocate the buffer and copy the boot script to the buffer.\r
   //\r
   Status = gBS->AllocatePool (\r
                   EfiBootServicesData,\r
@@ -954,12 +954,12 @@ S3BootScriptCloseTable (
                   (VOID **) &Buffer\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-        return 0; \r
+        return 0;\r
   }\r
   CopyMem (Buffer, S3TableBase, TableLength);\r
-  \r
+\r
   //\r
-  // Destroy the table maintained by the library so that the next write operation \r
+  // Destroy the table maintained by the library so that the next write operation\r
   // will write the record to the first entry of the table.\r
   //\r
   // Fill the table header.\r
@@ -967,12 +967,12 @@ S3BootScriptCloseTable (
   ScriptTableInfo->OpCode      = S3_BOOT_SCRIPT_LIB_TABLE_OPCODE;\r
   ScriptTableInfo->Length      = (UINT8) sizeof (EFI_BOOT_SCRIPT_TABLE_HEADER);\r
   ScriptTableInfo->TableLength = 0;   // will be calculate at close the table\r
-  \r
+\r
   mS3BootScriptTablePtr->TableLength = sizeof (EFI_BOOT_SCRIPT_TABLE_HEADER);\r
   return Buffer;\r
 }\r
 /**\r
-  Save I/O write to boot script \r
+  Save I/O write to boot script\r
 \r
   @param Width   The width of the I/O operations.Enumerated in S3_BOOT_SCRIPT_LIB_WIDTH.\r
   @param Address The base address of the I/O operations.\r
@@ -999,7 +999,7 @@ S3BootScriptSaveIoWrite (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_WRITE) + (WidthInByte * Count));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -1047,7 +1047,7 @@ S3BootScriptSaveIoReadWrite (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -1059,7 +1059,7 @@ S3BootScriptSaveIoReadWrite (
   ScriptIoReadWrite.Length  = Length;\r
   ScriptIoReadWrite.Width   = Width;\r
   ScriptIoReadWrite.Address = Address;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptIoReadWrite, sizeof(EFI_BOOT_SCRIPT_IO_READ_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE)), Data, WidthInByte);\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_IO_READ_WRITE) + WidthInByte), DataMask, WidthInByte);\r
@@ -1092,14 +1092,14 @@ S3BootScriptSaveMemWrite (
   UINT8                *Script;\r
   UINT8                 WidthInByte;\r
   EFI_BOOT_SCRIPT_MEM_WRITE  ScriptMemWrite;\r
-  \r
+\r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_WRITE) + (WidthInByte * Count));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
   //\r
@@ -1108,10 +1108,10 @@ S3BootScriptSaveMemWrite (
   ScriptMemWrite.Width    = Width;\r
   ScriptMemWrite.Address  = Address;\r
   ScriptMemWrite.Count    = (UINT32) Count;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptMemWrite, sizeof(EFI_BOOT_SCRIPT_MEM_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_WRITE)), Buffer, WidthInByte * Count);\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1140,22 +1140,22 @@ S3BootScriptSaveMemReadWrite (
   UINT8                *Script;\r
   UINT8                 WidthInByte;\r
   EFI_BOOT_SCRIPT_MEM_READ_WRITE  ScriptMemReadWrite;\r
\r
+\r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  } \r
+  }\r
   //\r
   // Build script data\r
-  //    \r
+  //\r
   ScriptMemReadWrite.OpCode   = EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE;\r
   ScriptMemReadWrite.Length   = Length;\r
   ScriptMemReadWrite.Width    = Width;\r
   ScriptMemReadWrite.Address  = Address;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptMemReadWrite , sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE)), Data, WidthInByte);\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_MEM_READ_WRITE) + WidthInByte), DataMask, WidthInByte);\r
@@ -1199,11 +1199,11 @@ S3BootScriptSavePciCfgWrite (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE) + (WidthInByte * Count));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  } \r
+  }\r
   //\r
   // Build script data\r
   //\r
@@ -1212,10 +1212,10 @@ S3BootScriptSavePciCfgWrite (
   ScriptPciWrite.Width    = Width;\r
   ScriptPciWrite.Address  = Address;\r
   ScriptPciWrite.Count    = (UINT32) Count;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite,  sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE)), Buffer, WidthInByte * Count);\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1255,19 +1255,19 @@ S3BootScriptSavePciCfgReadWrite (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
-  // \r
+  //\r
   ScriptPciReadWrite.OpCode   = EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE;\r
   ScriptPciReadWrite.Length   = Length;\r
   ScriptPciReadWrite.Width    = Width;\r
   ScriptPciReadWrite.Address  = Address;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE)), Data, WidthInByte);\r
   CopyMem (\r
@@ -1318,11 +1318,11 @@ S3BootScriptSavePciCfg2Write (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE) + (WidthInByte * Count));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
   //\r
@@ -1332,7 +1332,7 @@ S3BootScriptSavePciCfg2Write (
   ScriptPciWrite2.Address  = Address;\r
   ScriptPciWrite2.Segment  = Segment;\r
   ScriptPciWrite2.Count    = (UINT32)Count;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptPciWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE)), Buffer, WidthInByte * Count);\r
 \r
@@ -1375,14 +1375,14 @@ S3BootScriptSavePciCfg2ReadWrite (
       Width == S3BootScriptWidthFillUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
   //\r
@@ -1391,7 +1391,7 @@ S3BootScriptSavePciCfg2ReadWrite (
   ScriptPciReadWrite2.Width    = Width;\r
   ScriptPciReadWrite2.Segment  = Segment;\r
   ScriptPciReadWrite2.Address  = Address;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptPciReadWrite2, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE)), Data, WidthInByte);\r
   CopyMem (\r
@@ -1399,7 +1399,7 @@ S3BootScriptSavePciCfg2ReadWrite (
     DataMask,\r
     WidthInByte\r
     );\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1412,7 +1412,7 @@ S3BootScriptSavePciCfg2ReadWrite (
   for certain SMBus bus protocol, it will return EFI_SUCCESS; otherwise, it will return certain\r
   error code based on the input SMBus bus protocol.\r
 \r
-  @param  SmBusAddress            Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, \r
+  @param  SmBusAddress            Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length,\r
                                   and PEC.\r
   @param  Operation               Signifies which particular SMBus hardware protocol instance that\r
                                   it will use to execute the SMBus transactions. This SMBus\r
@@ -1428,7 +1428,7 @@ S3BootScriptSavePciCfg2ReadWrite (
                                   buffer is identified by Length.\r
 \r
   @retval EFI_SUCCESS             All the parameters are valid for the corresponding SMBus bus\r
-                                  protocol. \r
+                                  protocol.\r
   @retval EFI_INVALID_PARAMETER   Operation is not defined in EFI_SMBUS_OPERATION.\r
   @retval EFI_INVALID_PARAMETER   Length/Buffer is NULL for operations except for EfiSmbusQuickRead\r
                                   and EfiSmbusQuickWrite. Length is outside the range of valid\r
@@ -1449,12 +1449,12 @@ CheckParameters (
   UINTN       RequiredLen;\r
   EFI_SMBUS_DEVICE_COMMAND Command;\r
   BOOLEAN                  PecCheck;\r
\r
+\r
   Command      = SMBUS_LIB_COMMAND (SmBusAddress);\r
   PecCheck     = SMBUS_LIB_PEC (SmBusAddress);\r
   //\r
   // Set default value to be 2:\r
-  // for SmbusReadWord, SmbusWriteWord and SmbusProcessCall. \r
+  // for SmbusReadWord, SmbusWriteWord and SmbusProcessCall.\r
   //\r
   RequiredLen = 2;\r
   Status      = EFI_SUCCESS;\r
@@ -1492,8 +1492,8 @@ CheckParameters (
     case EfiSmbusReadBlock:\r
     case EfiSmbusWriteBlock:\r
     case EfiSmbusBWBRProcessCall:\r
-      if ((Buffer == NULL) || \r
-          (Length == NULL) || \r
+      if ((Buffer == NULL) ||\r
+          (Length == NULL) ||\r
           (*Length < MIN_SMBUS_BLOCK_LEN) ||\r
           (*Length > MAX_SMBUS_BLOCK_LEN)) {\r
         return EFI_INVALID_PARAMETER;\r
@@ -1513,14 +1513,14 @@ CheckParameters (
                         transactions.\r
   @param Length         A pointer to signify the number of bytes that this operation will do.\r
   @param Buffer         Contains the value of data to execute to the SMBUS slave device.\r
-  \r
+\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
 S3BootScriptSaveSmbusExecute (\r
-  IN  UINTN                             SmBusAddress, \r
+  IN  UINTN                             SmBusAddress,\r
   IN  EFI_SMBUS_OPERATION               Operation,\r
   IN  UINTN                             *Length,\r
   IN  VOID                              *Buffer\r
@@ -1544,7 +1544,7 @@ S3BootScriptSaveSmbusExecute (
   }\r
 \r
   DataSize = (UINT8)(sizeof (EFI_BOOT_SCRIPT_SMBUS_EXECUTE) + BufferLength);\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (DataSize);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -1573,7 +1573,7 @@ S3BootScriptSaveSmbusExecute (
   Adds a record for an execution stall on the processor into a specified boot script table.\r
 \r
   @param Duration   Duration in microseconds of the stall\r
-  \r
+\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
 **/\r
@@ -1588,20 +1588,20 @@ S3BootScriptSaveStall (
   EFI_BOOT_SCRIPT_STALL  ScriptStall;\r
 \r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_STALL));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
   //\r
   ScriptStall.OpCode    = EFI_BOOT_SCRIPT_STALL_OPCODE;\r
   ScriptStall.Length    = Length;\r
   ScriptStall.Duration  = Duration;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptStall, sizeof (EFI_BOOT_SCRIPT_STALL));\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1611,7 +1611,7 @@ S3BootScriptSaveStall (
 \r
   @param EntryPoint   Entry point of the code to be dispatched.\r
   @param Context      Argument to be passed into the EntryPoint of the code to be dispatched.\r
-  \r
+\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
 **/\r
@@ -1626,11 +1626,11 @@ S3BootScriptSaveDispatch2 (
   UINT8                 *Script;\r
   EFI_BOOT_SCRIPT_DISPATCH_2  ScriptDispatch2;\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_DISPATCH_2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
   //\r
@@ -1638,9 +1638,9 @@ S3BootScriptSaveDispatch2 (
   ScriptDispatch2.Length     = Length;\r
   ScriptDispatch2.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;\r
   ScriptDispatch2.Context =   (EFI_PHYSICAL_ADDRESS)(UINTN)Context;\r
-  \r
+\r
   CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch2, sizeof (EFI_BOOT_SCRIPT_DISPATCH_2));\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1679,13 +1679,13 @@ S3BootScriptSaveMemPoll (
 {\r
   UINT8                 Length;\r
   UINT8                *Script;\r
-  UINT8                 WidthInByte; \r
-  EFI_BOOT_SCRIPT_MEM_POLL      ScriptMemPoll; \r
+  UINT8                 WidthInByte;\r
+  EFI_BOOT_SCRIPT_MEM_POLL      ScriptMemPoll;\r
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
-  \r
+\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_MEM_POLL) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -1695,14 +1695,14 @@ S3BootScriptSaveMemPoll (
   //\r
   ScriptMemPoll.OpCode   = EFI_BOOT_SCRIPT_MEM_POLL_OPCODE;\r
   ScriptMemPoll.Length   = Length;\r
-  ScriptMemPoll.Width    = Width;  \r
+  ScriptMemPoll.Width    = Width;\r
   ScriptMemPoll.Address  = Address;\r
   ScriptMemPoll.Duration = Duration;\r
   ScriptMemPoll.LoopTimes = LoopTimes;\r
 \r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL)), BitValue, WidthInByte);\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_MEM_POLL) + WidthInByte), BitMask, WidthInByte);\r
-  CopyMem ((VOID*)Script, (VOID*)&ScriptMemPoll, sizeof (EFI_BOOT_SCRIPT_MEM_POLL)); \r
+  CopyMem ((VOID*)Script, (VOID*)&ScriptMemPoll, sizeof (EFI_BOOT_SCRIPT_MEM_POLL));\r
 \r
   SyncBootScript (Script);\r
 \r
@@ -1711,10 +1711,10 @@ S3BootScriptSaveMemPoll (
 /**\r
   Store arbitrary information in the boot script table. This opcode is a no-op on dispatch and is only\r
   used for debugging script issues.\r
-  \r
+\r
   @param InformationLength   Length of the data in bytes\r
   @param Information       Information to be logged in the boot scrpit\r
\r
+\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
 \r
@@ -1722,7 +1722,7 @@ S3BootScriptSaveMemPoll (
 RETURN_STATUS\r
 EFIAPI\r
 S3BootScriptSaveInformation (\r
-  IN  UINT32                                InformationLength, \r
+  IN  UINT32                                InformationLength,\r
   IN  VOID                                 *Information\r
   )\r
 {\r
@@ -1743,7 +1743,7 @@ S3BootScriptSaveInformation (
   ScriptInformation.Length     = Length;\r
 \r
 \r
-  ScriptInformation.InformationLength = InformationLength;  \r
+  ScriptInformation.InformationLength = InformationLength;\r
 \r
   CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION)), (VOID *) Information, (UINTN) InformationLength);\r
@@ -1756,9 +1756,9 @@ S3BootScriptSaveInformation (
 /**\r
   Store a string in the boot script table. This opcode is a no-op on dispatch and is only\r
   used for debugging script issues.\r
-  \r
+\r
   @param String            The string to save to boot script table\r
-  \r
+\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
 \r
@@ -1769,8 +1769,8 @@ S3BootScriptSaveInformationAsciiString (
   IN  CONST CHAR8               *String\r
   )\r
 {\r
-  return S3BootScriptSaveInformation (      \r
-           (UINT32) AsciiStrLen (String) + 1, \r
+  return S3BootScriptSaveInformation (\r
+           (UINT32) AsciiStrLen (String) + 1,\r
            (VOID*) String\r
            );\r
 }\r
@@ -1778,7 +1778,7 @@ S3BootScriptSaveInformationAsciiString (
   Adds a record for dispatching specified arbitrary code into a specified boot script table.\r
 \r
   @param EntryPoint   Entry point of the code to be dispatched.\r
-  \r
+\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
 **/\r
@@ -1791,22 +1791,22 @@ S3BootScriptSaveDispatch (
   UINT8                 Length;\r
   UINT8                *Script;\r
   EFI_BOOT_SCRIPT_DISPATCH  ScriptDispatch;\r
-  \r
+\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_DISPATCH));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  }  \r
+  }\r
   //\r
   // Build script data\r
   //\r
   ScriptDispatch.OpCode     = EFI_BOOT_SCRIPT_DISPATCH_OPCODE;\r
   ScriptDispatch.Length     = Length;\r
   ScriptDispatch.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;\r
-  \r
-  CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch, sizeof (EFI_BOOT_SCRIPT_DISPATCH)); \r
-  \r
+\r
+  CopyMem ((VOID*)Script, (VOID*)&ScriptDispatch, sizeof (EFI_BOOT_SCRIPT_DISPATCH));\r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1815,8 +1815,8 @@ S3BootScriptSaveDispatch (
 /**\r
   Adds a record for I/O reads the I/O location and continues when the exit criteria is satisfied or after a\r
   defined duration.\r
-  \r
-  @param  Width                 The width of the I/O operations. \r
+\r
+  @param  Width                 The width of the I/O operations.\r
   @param  Address               The base address of the I/O operations.\r
   @param  Data                  The comparison value used for the polling exit criteria.\r
   @param  DataMask              Mask used for the polling criteria. The bits in the bytes below Width which are zero\r
@@ -1834,36 +1834,36 @@ S3BootScriptSaveIoPoll (
   IN S3_BOOT_SCRIPT_LIB_WIDTH       Width,\r
   IN UINT64                     Address,\r
   IN VOID                      *Data,\r
-  IN VOID                      *DataMask, \r
-  IN UINT64                     Delay   \r
+  IN VOID                      *DataMask,\r
+  IN UINT64                     Delay\r
   )\r
 {\r
-  UINT8                 WidthInByte;  \r
+  UINT8                 WidthInByte;\r
   UINT8                *Script;\r
   UINT8                 Length;\r
   EFI_BOOT_SCRIPT_IO_POLL  ScriptIoPoll;\r
-  \r
 \r
-  WidthInByte = (UINT8) (0x01 << (Width & 0x03));  \r
+\r
+  WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_IO_POLL) + (WidthInByte * 2));\r
\r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  } \r
+  }\r
   //\r
   // Build script data\r
   //\r
   ScriptIoPoll.OpCode   = EFI_BOOT_SCRIPT_IO_POLL_OPCODE;\r
   ScriptIoPoll.Length   = (UINT8) (sizeof (EFI_BOOT_SCRIPT_IO_POLL) + (WidthInByte * 2));\r
-  ScriptIoPoll.Width    = Width;  \r
+  ScriptIoPoll.Width    = Width;\r
   ScriptIoPoll.Address  = Address;\r
   ScriptIoPoll.Delay    = Delay;\r
 \r
-  CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL));  \r
+  CopyMem ((VOID*)Script, (VOID*)&ScriptIoPoll, sizeof (EFI_BOOT_SCRIPT_IO_POLL));\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL)), Data, WidthInByte);\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_IO_POLL) + WidthInByte), DataMask, WidthInByte);\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1873,7 +1873,7 @@ S3BootScriptSaveIoPoll (
   Adds a record for PCI configuration space reads and continues when the exit criteria is satisfied or\r
   after a defined duration.\r
 \r
-  @param  Width                 The width of the I/O operations. \r
+  @param  Width                 The width of the I/O operations.\r
   @param  Address               The address within the PCI configuration space.\r
   @param  Data                  The comparison value used for the polling exit criteria.\r
   @param  DataMask              Mask used for the polling criteria. The bits in the bytes below Width which are zero\r
@@ -1897,7 +1897,7 @@ S3BootScriptSavePciPoll (
 )\r
 {\r
   UINT8                   *Script;\r
-  UINT8                    WidthInByte;  \r
+  UINT8                    WidthInByte;\r
   UINT8                    Length;\r
   EFI_BOOT_SCRIPT_PCI_CONFIG_POLL  ScriptPciPoll;\r
 \r
@@ -1909,7 +1909,7 @@ S3BootScriptSavePciPoll (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -1919,14 +1919,14 @@ S3BootScriptSavePciPoll (
   //\r
   ScriptPciPoll.OpCode   = EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE;\r
   ScriptPciPoll.Length   = (UINT8) (sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + (WidthInByte * 2));\r
-  ScriptPciPoll.Width    = Width;  \r
+  ScriptPciPoll.Width    = Width;\r
   ScriptPciPoll.Address  = Address;\r
   ScriptPciPoll.Delay    = Delay;\r
 \r
   CopyMem ((VOID*)Script, (VOID*)&ScriptPciPoll, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL));\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL)), Data, WidthInByte);\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG_POLL) + WidthInByte), DataMask, WidthInByte);\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
@@ -1935,7 +1935,7 @@ S3BootScriptSavePciPoll (
   Adds a record for PCI configuration space reads and continues when the exit criteria is satisfied or\r
   after a defined duration.\r
 \r
-  @param  Width                 The width of the I/O operations. \r
+  @param  Width                 The width of the I/O operations.\r
   @param  Segment               The PCI segment number for Address.\r
   @param  Address               The address within the PCI configuration space.\r
   @param  Data                  The comparison value used for the polling exit criteria.\r
@@ -1960,7 +1960,7 @@ S3BootScriptSavePci2Poll (
   IN UINT64                         Delay\r
 )\r
 {\r
-  UINT8                    WidthInByte;  \r
+  UINT8                    WidthInByte;\r
   UINT8                   *Script;\r
   UINT8                    Length;\r
   EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL  ScriptPci2Poll;\r
@@ -1974,17 +1974,17 @@ S3BootScriptSavePci2Poll (
 \r
   WidthInByte = (UINT8) (0x01 << (Width & 0x03));\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + (WidthInByte * 2));\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
-  } \r
+  }\r
   //\r
   // Build script data\r
   //\r
   ScriptPci2Poll.OpCode   = EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE;\r
   ScriptPci2Poll.Length   = (UINT8) (sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + (WidthInByte * 2));\r
-  ScriptPci2Poll.Width    = Width; \r
+  ScriptPci2Poll.Width    = Width;\r
   ScriptPci2Poll.Segment  = Segment;\r
   ScriptPci2Poll.Address  = Address;\r
   ScriptPci2Poll.Delay    = Delay;\r
@@ -1992,17 +1992,17 @@ S3BootScriptSavePci2Poll (
   CopyMem ((VOID*)Script, (VOID*)&ScriptPci2Poll, sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL));\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL)), Data, WidthInByte);\r
   CopyMem ((UINT8 *) (Script + sizeof (EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL) + WidthInByte), DataMask, WidthInByte);\r
-  \r
+\r
   SyncBootScript (Script);\r
 \r
   return RETURN_SUCCESS;\r
 }\r
 /**\r
   Do the calculation of start address from which a new s3 boot script entry will write into.\r
-  \r
+\r
   @param EntryLength      The new entry length.\r
   @param Position         specifies the position in the boot script table where the opcode will be\r
-                          inserted, either before or after, depending on BeforeOrAfter. \r
+                          inserted, either before or after, depending on BeforeOrAfter.\r
   @param BeforeOrAfter    The flag to indicate to insert the nod before or after the position.\r
                           This parameter is effective when InsertFlag is TRUE\r
   @param Script           return out the position from which the a new s3 boot script entry will write into\r
@@ -2012,58 +2012,58 @@ S3BootScriptCalculateInsertAddress (
   IN  UINT8     EntryLength,\r
   IN  VOID     *Position OPTIONAL,\r
   IN  BOOLEAN   BeforeOrAfter OPTIONAL,\r
-  OUT UINT8   **Script   \r
+  OUT UINT8   **Script\r
   )\r
 {\r
    UINTN                            TableLength;\r
    UINT8                            *S3TableBase;\r
-   UINTN                            PositionOffset; \r
+   UINTN                            PositionOffset;\r
    EFI_BOOT_SCRIPT_COMMON_HEADER     ScriptHeader;\r
    //\r
    // The entry inserting to table is already added to the end of the table\r
    //\r
    TableLength =  mS3BootScriptTablePtr->TableLength - EntryLength;\r
    S3TableBase = mS3BootScriptTablePtr->TableBase ;\r
-   // \r
+   //\r
    // calculate the Position offset\r
    //\r
    if (Position != NULL) {\r
      PositionOffset = (UINTN) ((UINT8 *)Position - S3TableBase);\r
-   \r
+\r
      //\r
      // If the BeforeOrAfter is FALSE, that means to insert the node right after the node.\r
      //\r
      if (!BeforeOrAfter) {\r
-        CopyMem ((VOID*)&ScriptHeader, Position, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));  \r
+        CopyMem ((VOID*)&ScriptHeader, Position, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));\r
         PositionOffset += (ScriptHeader.Length);\r
      }\r
-     //     \r
+     //\r
      // Insert the node before the adjusted Position\r
      //\r
-     CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset);  \r
+     CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset);\r
      //\r
-     // calculate the the start address for the new entry. \r
+     // calculate the the start address for the new entry.\r
      //\r
      *Script = S3TableBase + PositionOffset;\r
-       \r
+\r
    } else {\r
      if (!BeforeOrAfter) {\r
        //\r
        //  Insert the node to the end of the table\r
        //\r
-       *Script = S3TableBase + TableLength; \r
+       *Script = S3TableBase + TableLength;\r
      } else {\r
-       // \r
+       //\r
        // Insert the node to the beginning of the table\r
        //\r
        PositionOffset = (UINTN) sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER);\r
-       CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset); \r
-       *Script = S3TableBase + PositionOffset; \r
+       CopyMem (S3TableBase+PositionOffset+EntryLength, S3TableBase+PositionOffset, TableLength - PositionOffset);\r
+       *Script = S3TableBase + PositionOffset;\r
      }\r
-   }       \r
+   }\r
 }\r
 /**\r
-  Move the last boot script entry to the position \r
+  Move the last boot script entry to the position\r
 \r
   @param  BeforeOrAfter         Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position\r
                                 in the boot script table specified by Position. If Position is NULL or points to\r
@@ -2085,14 +2085,14 @@ S3BootScriptMoveLastOpcode (
 )\r
 {\r
   UINT8*                Script;\r
-  VOID                  *TempPosition;  \r
+  VOID                  *TempPosition;\r
   UINTN                 StartAddress;\r
   UINT32                TableLength;\r
   EFI_BOOT_SCRIPT_COMMON_HEADER  ScriptHeader;\r
   BOOLEAN               ValidatePosition;\r
   UINT8*                LastOpcode;\r
   UINT8                 TempBootScriptEntry[BOOT_SCRIPT_NODE_MAX_LENGTH];\r
-  \r
+\r
   ValidatePosition = FALSE;\r
   TempPosition = (Position == NULL) ? NULL:(*Position);\r
 \r
@@ -2112,17 +2112,17 @@ S3BootScriptMoveLastOpcode (
   //\r
   // Find the last boot Script Entry which is not the terminate node\r
   //\r
-  while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {    \r
-    CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));   \r
+  while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {\r
+    CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));\r
     if (TempPosition != NULL && TempPosition == Script) {\r
       //\r
-      // If the position is specified, the position must be pointed to a boot script entry start address. \r
+      // If the position is specified, the position must be pointed to a boot script entry start address.\r
       //\r
       ValidatePosition = TRUE;\r
     }\r
     if (ScriptHeader.OpCode != S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE) {\r
       LastOpcode = Script;\r
-    } \r
+    }\r
     Script  = Script + ScriptHeader.Length;\r
   }\r
   //\r
@@ -2131,10 +2131,10 @@ S3BootScriptMoveLastOpcode (
   if (TempPosition != NULL && !ValidatePosition) {\r
     return RETURN_INVALID_PARAMETER;\r
   }\r
-  \r
-  CopyMem ((VOID*)&ScriptHeader, LastOpcode, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER)); \r
-  \r
-  CopyMem((VOID*)TempBootScriptEntry, LastOpcode, ScriptHeader.Length); \r
+\r
+  CopyMem ((VOID*)&ScriptHeader, LastOpcode, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));\r
+\r
+  CopyMem((VOID*)TempBootScriptEntry, LastOpcode, ScriptHeader.Length);\r
   //\r
   // Find the right position to write the node in\r
   //\r
@@ -2142,7 +2142,7 @@ S3BootScriptMoveLastOpcode (
     ScriptHeader.Length,\r
     TempPosition,\r
     BeforeOrAfter,\r
-    &Script   \r
+    &Script\r
   );\r
   //\r
   // Copy the node to Boot script table\r
@@ -2160,18 +2160,18 @@ S3BootScriptMoveLastOpcode (
   return RETURN_SUCCESS;\r
 }\r
 /**\r
-  Create a Label node in the boot script table. \r
-  \r
+  Create a Label node in the boot script table.\r
+\r
   @param  BeforeOrAfter         Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position\r
                                 in the boot script table specified by Position. If Position is NULL or points to\r
                                 NULL then the new opcode is inserted at the beginning of the table (if TRUE) or end\r
                                 of the table (if FALSE).\r
   @param  Position              On entry, specifies the position in the boot script table where the opcode will be\r
                                 inserted, either before or after, depending on BeforeOrAfter. On exit, specifies\r
-                                the position of the inserted opcode in the boot script table.  \r
+                                the position of the inserted opcode in the boot script table.\r
   @param InformationLength      Length of the label in bytes\r
   @param Information            Label to be logged in the boot scrpit\r
\r
+\r
   @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the boot script table.\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
@@ -2181,17 +2181,17 @@ RETURN_STATUS
 EFIAPI\r
 S3BootScriptLabelInternal (\r
   IN        BOOLEAN                        BeforeOrAfter,\r
-  IN OUT    VOID                         **Position OPTIONAL, \r
-  IN        UINT32                         InformationLength, \r
+  IN OUT    VOID                         **Position OPTIONAL,\r
+  IN        UINT32                         InformationLength,\r
   IN CONST  CHAR8                          *Information\r
   )\r
 {\r
   UINT8                 Length;\r
   UINT8                 *Script;\r
   EFI_BOOT_SCRIPT_INFORMATION  ScriptInformation;\r
\r
+\r
   Length = (UINT8)(sizeof (EFI_BOOT_SCRIPT_INFORMATION) + InformationLength);\r
-  \r
+\r
   Script = S3BootScriptGetEntryAddAddress (Length);\r
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -2203,7 +2203,7 @@ S3BootScriptLabelInternal (
   ScriptInformation.Length     = Length;\r
 \r
 \r
-  ScriptInformation.InformationLength = InformationLength;  \r
+  ScriptInformation.InformationLength = InformationLength;\r
 \r
   CopyMem ((VOID*)Script, (VOID*)&ScriptInformation, sizeof (EFI_BOOT_SCRIPT_INFORMATION));\r
   CopyMem ((VOID*)(Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION)), (VOID *) Information, (UINTN) InformationLength);\r
@@ -2217,9 +2217,9 @@ S3BootScriptLabelInternal (
   Find a label within the boot script table and, if not present, optionally create it.\r
 \r
   @param  BeforeOrAfter         Specifies whether the opcode is stored before (TRUE)\r
-                                or after (FALSE) the position in the boot script table \r
+                                or after (FALSE) the position in the boot script table\r
                                 specified by Position.\r
-  @param  CreateIfNotFound      Specifies whether the label will be created if the label \r
+  @param  CreateIfNotFound      Specifies whether the label will be created if the label\r
                                 does not exists (TRUE) or not (FALSE).\r
   @param  Position              On entry, specifies the position in the boot script table\r
                                 where the opcode will be inserted, either before or after,\r
@@ -2230,13 +2230,13 @@ S3BootScriptLabelInternal (
   @retval EFI_SUCCESS           The operation succeeded. A record was added into the\r
                                 specified script table.\r
   @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r
-                                If the opcode is unknow or not supported because of the PCD \r
+                                If the opcode is unknow or not supported because of the PCD\r
                                 Feature Flags.\r
   @retval EFI_OUT_OF_RESOURCES  There is insufficient memory to store the boot script.\r
 \r
 **/\r
 RETURN_STATUS\r
-EFIAPI \r
+EFIAPI\r
 S3BootScriptLabel (\r
   IN       BOOLEAN                      BeforeOrAfter,\r
   IN       BOOLEAN                      CreateIfNotFound,\r
@@ -2262,7 +2262,7 @@ S3BootScriptLabel (
   if (Label[0] == '\0') {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check that the script is initialized and synced without adding an entry to the script.\r
   // The code must search for the label first before it knows if a new entry needs\r
@@ -2272,10 +2272,10 @@ S3BootScriptLabel (
   if (Script == NULL) {\r
     return RETURN_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // Check the header and search for existing label.\r
-  // \r
+  //\r
   Script = mS3BootScriptTablePtr->TableBase;\r
   CopyMem ((VOID*)&TableHeader, Script, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));\r
   if (TableHeader.OpCode != S3_BOOT_SCRIPT_LIB_TABLE_OPCODE) {\r
@@ -2285,22 +2285,22 @@ S3BootScriptLabel (
   TableLength   = mS3BootScriptTablePtr->TableLength;\r
   Script    =     Script + TableHeader.Length;\r
   while ((UINTN) Script < (UINTN) (StartAddress + TableLength)) {\r
-    \r
-    CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));   \r
+\r
+    CopyMem ((VOID*)&ScriptHeader, Script, sizeof(EFI_BOOT_SCRIPT_COMMON_HEADER));\r
     if (ScriptHeader.OpCode == S3_BOOT_SCRIPT_LIB_LABEL_OPCODE) {\r
       if (AsciiStrCmp ((CHAR8 *)(UINTN)(Script+sizeof(EFI_BOOT_SCRIPT_INFORMATION)), Label) == 0) {\r
-        (*Position) = Script; \r
+        (*Position) = Script;\r
         return EFI_SUCCESS;\r
       }\r
-    } \r
+    }\r
     Script  = Script + ScriptHeader.Length;\r
   }\r
   if (CreateIfNotFound) {\r
     LabelLength = (UINT32)AsciiStrSize(Label);\r
-    return S3BootScriptLabelInternal (BeforeOrAfter,Position, LabelLength, Label);     \r
+    return S3BootScriptLabelInternal (BeforeOrAfter,Position, LabelLength, Label);\r
   } else {\r
     return EFI_NOT_FOUND;\r
-  }   \r
+  }\r
 }\r
 \r
 /**\r
@@ -2312,13 +2312,13 @@ S3BootScriptLabel (
   @retval EFI_SUCCESS           The operation succeeded. A record was added into the\r
                                 specified script table.\r
   @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r
-                                If the opcode is unknow or not supported because of the PCD \r
+                                If the opcode is unknow or not supported because of the PCD\r
                                 Feature Flags.\r
   @retval EFI_OUT_OF_RESOURCES  There is insufficient memory to store the boot script.\r
 \r
 **/\r
 RETURN_STATUS\r
-EFIAPI \r
+EFIAPI\r
 S3BootScriptCompare (\r
   IN  UINT8                       *Position1,\r
   IN  UINT8                       *Position2,\r
@@ -2326,7 +2326,7 @@ S3BootScriptCompare (
   )\r
 {\r
   UINT8*                    Script;\r
-  UINT32                    TableLength; \r
+  UINT32                    TableLength;\r
 \r
   if (RelativePosition == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -2352,7 +2352,7 @@ S3BootScriptCompare (
     return EFI_INVALID_PARAMETER;\r
   }\r
   *RelativePosition = (Position1 < Position2)?-1:((Position1 == Position2)?0:1);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
index de314db4792289330b31d215f8d1cf382a30d322..4125cdd70f101ec35220cd9ceb4cb013c9c9d7a9 100644 (file)
@@ -53,7 +53,7 @@
   UefiLib\r
   SmbusLib\r
   PciLib\r
-  IoLib \r
+  IoLib\r
   LockBoxLib\r
 \r
 [Protocols]\r
index 95b589c0ca9c3f2e5f1f0ce8254a02f43594def0..b6e576ed8ad87bab13851c0a4c45b704fa16c010 100644 (file)
@@ -9,7 +9,7 @@
 // licensed and made available under the terms and conditions of the BSD License\r
 // which accompanies this distribution.  The full text of the license may be found at\r
 // http://opensource.org/licenses/bsd-license.php\r
-// \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
 //\r
index e54027848346f9e81a270da652088aab398285ea..9b150480dbcabb7fd5e6c2b18bbc59887e185f05 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Support for S3 boot script lib. This file defined some internal macro and internal \r
+  Support for S3 boot script lib. This file defined some internal macro and internal\r
   data structure\r
\r
+\r
   Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -50,7 +50,7 @@
 #define PCI_ADDRESS_ENCODE(A) (UINTN)PCI_LIB_ADDRESS( \\r
         ((((UINTN)(A))& 0xff000000) >> 24), ((((UINTN)(A)) &0x00ff0000) >> 16), ((((UINTN)(A)) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \\r
         )\r
-        \r
+\r
 \r
 \r
 typedef union {\r
@@ -73,8 +73,8 @@ typedef union {
 //\r
 typedef struct {\r
   UINT8     *TableBase;\r
-  UINT32    TableLength;            // Record the actual memory length \r
-  UINT16    TableMemoryPageNumber;  // Record the page number Allocated for the table \r
+  UINT32    TableLength;            // Record the actual memory length\r
+  UINT16    TableMemoryPageNumber;  // Record the page number Allocated for the table\r
   BOOLEAN   InSmm;                  // Record if this library is in SMM.\r
   BOOLEAN   AtRuntime;              // Record if current state is after SmmExitBootServices or SmmLegacyBoot.\r
   UINT32    BootTimeScriptLength;   // Maintain boot time script length in LockBox after SmmReadyToLock in SMM.\r