]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseS3BootScriptLibNull / BootScriptLib.c
index 373ce6b388e5712bf88f0720ff383ec4f2231d23..7d678d7c7f5910702550bf46147773e06584822f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Null function implementation for EFI S3 boot script. \r
+  Null function implementation for EFI S3 boot script.\r
 \r
-  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -19,7 +19,7 @@
 #include <Library/S3BootScriptLib.h>\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
@@ -38,7 +38,7 @@ S3BootScriptSaveIoWrite (
   IN  VOID                              *Buffer\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -61,7 +61,7 @@ S3BootScriptSaveIoReadWrite (
   IN  VOID                            *DataMask\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -84,7 +84,7 @@ S3BootScriptSaveMemWrite (
   IN  VOID                              *Buffer\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Adds a record for a memory modify operation into a specified boot script table.\r
@@ -106,7 +106,7 @@ S3BootScriptSaveMemReadWrite (
   IN  VOID                              *DataMask\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Adds a record for a PCI configuration space write operation into a specified boot script table.\r
@@ -128,7 +128,7 @@ S3BootScriptSavePciCfgWrite (
   IN  VOID                            *Buffer\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -151,7 +151,7 @@ S3BootScriptSavePciCfgReadWrite (
   IN  VOID                              *DataMask\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Adds a record for a PCI configuration space modify operation into a specified boot script table.\r
@@ -175,7 +175,7 @@ S3BootScriptSavePciCfg2Write (
   IN VOID                           *Buffer\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Adds a record for a PCI configuration space modify operation into a specified boot script table.\r
@@ -198,8 +198,8 @@ S3BootScriptSavePciCfg2ReadWrite (
   IN VOID                           *Data,\r
   IN VOID                           *DataMask\r
   )\r
-{ \r
-       return RETURN_SUCCESS;\r
+{\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Adds a record for an SMBus command execution into a specified boot script table.\r
@@ -209,26 +209,26 @@ S3BootScriptSavePciCfg2ReadWrite (
                         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
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   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
@@ -238,13 +238,13 @@ S3BootScriptSaveStall (
   IN  UINTN                             Duration\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   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
@@ -261,7 +261,7 @@ S3BootScriptSaveDispatch (
 \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
@@ -272,13 +272,13 @@ S3BootScriptSaveDispatch2 (
   IN  VOID                              *Context\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
   Adds a record for memory reads of the memory location and continues when the exit criteria is\r
   satisfied or after a defined duration.\r
\r
+\r
   Please aware, below interface is different with PI specification, Vol 5:\r
   EFI_S3_SAVE_STATE_PROTOCOL.Write() for EFI_BOOT_SCRIPT_MEM_POLL_OPCODE.\r
   "Duration" below is microseconds, while "Delay" in PI specification means\r
@@ -303,19 +303,19 @@ S3BootScriptSaveMemPoll (
   IN  VOID                              *BitMask,\r
   IN  VOID                              *BitValue,\r
   IN  UINTN                             Duration,\r
-  IN  UINT                            LoopTimes\r
+  IN  UINT64                            LoopTimes\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\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_UNSUPPORTED   If  entering runtime, this method will not support.\r
   @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
   @retval RETURN_SUCCESS           Opcode is added.\r
@@ -324,17 +324,17 @@ S3BootScriptSaveMemPoll (
 RETURN_STATUS\r
 EFIAPI\r
 S3BootScriptSaveInformation (\r
-  IN  UINT32                   InformationLength, \r
+  IN  UINT32                   InformationLength,\r
   IN  VOID                    *Information\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\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
@@ -352,18 +352,18 @@ 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
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
   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
@@ -385,13 +385,13 @@ S3BootScriptSavePciPoll (
    IN UINT64                     Delay\r
  )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   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
@@ -403,7 +403,7 @@ S3BootScriptSavePciPoll (
  @retval RETURN_OUT_OF_RESOURCES  Not enough memory for the table do operation.\r
  @retval RETURN_SUCCESS           Opcode is added.\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
 **/\r
@@ -418,7 +418,7 @@ S3BootScriptSavePci2Poll (
    IN UINT64                        Delay\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Save ASCII string information specified by Buffer to\r
@@ -436,31 +436,31 @@ S3BootScriptSaveInformationAsciiString (
   IN  CONST CHAR8               *String\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\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
+  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. By then it is not\r
   necessary to provide this API in BootScriptLib. To provides this API for now is only to meet\r
   the requirement from Framework Spec.\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 on an 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 on an 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
 \r
 **/\r
 UINT8*\r
@@ -469,13 +469,13 @@ S3BootScriptCloseTable (
   VOID\r
   )\r
 {\r
-       return 0;\r
+  return 0;\r
 }\r
 /**\r
   Executes the S3 boot script table.\r
 \r
   @param RETURN_SUCCESS           The boot script table was executed successfully.\r
-  @param RETURN_UNSUPPORTED       Invalid script table or opcode.  \r
+  @param RETURN_UNSUPPORTED       Invalid script table or opcode.\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
@@ -483,10 +483,10 @@ S3BootScriptExecute (
    VOID\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\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
@@ -507,15 +507,15 @@ S3BootScriptMoveLastOpcode (
   IN OUT VOID                         **Position OPTIONAL\r
 )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   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
@@ -526,13 +526,13 @@ S3BootScriptMoveLastOpcode (
   @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
@@ -540,7 +540,7 @@ S3BootScriptLabel (
   IN CONST CHAR8                       *Label\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r
 /**\r
   Compare two positions in the boot script table and return their relative position.\r
@@ -551,18 +551,18 @@ 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
   OUT UINTN                       *RelativePosition\r
   )\r
 {\r
-       return RETURN_SUCCESS;\r
+  return RETURN_SUCCESS;\r
 }\r