]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c
MdeModulePkg/S3SaveState: Extract arguments in correct order
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / S3SaveStateDxe / S3SaveState.c
index e86d39e678390d6cc0139f372c53ec8a29bb84b6..d73005156cc6e172a1e6ff35c892d4218bb1759f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation for S3 Boot Script Saver state driver.\r
 \r
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -210,10 +210,10 @@ BootScriptWritePciCfg2Write (
   UINT16                Segment;\r
 \r
   Width       = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);\r
+  Segment     = VA_ARG (Marker, UINT16);\r
   Address     = VA_ARG (Marker, UINT64);\r
   Count       = VA_ARG (Marker, UINTN);\r
   Buffer      = VA_ARG (Marker, UINT8 *);\r
-  Segment     = VA_ARG (Marker, UINT16);\r
 \r
   return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buffer);\r
 }\r
@@ -240,15 +240,15 @@ BootScriptWritePciCfg2ReadWrite (
   UINT8                 *DataMask;\r
  \r
   Width       = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);\r
-  Address     = VA_ARG (Marker, UINT64);\r
   Segment     = VA_ARG (Marker, UINT16);\r
+  Address     = VA_ARG (Marker, UINT64);\r
   Data        = VA_ARG (Marker, UINT8 *);\r
   DataMask    = VA_ARG (Marker, UINT8 *);\r
  \r
   return S3BootScriptSavePciCfg2ReadWrite (Width, Segment, Address, Data, DataMask);\r
 }\r
 /**\r
-  Internal function to add smbus excute opcode to the table.\r
+  Internal function to add smbus execute opcode to the table.\r
 \r
   @param  Marker                The variable argument list to get the opcode\r
                                 and associated attributes.\r
@@ -343,15 +343,15 @@ BootScriptWriteMemPoll (
   UINT64                     Address;                                    \r
   VOID                      *Data;                                    \r
   VOID                      *DataMask;                                  \r
-  UINTN                     Delay;                                   \r
-  UINT                    LoopTimes;\r
+  UINT64                    Delay;\r
+  UINT64                    LoopTimes;\r
   UINT32                    Remainder;\r
 \r
   Width    = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);                  \r
   Address  = VA_ARG (Marker, UINT64);                                    \r
   Data     = VA_ARG (Marker, VOID *);                                    \r
   DataMask = VA_ARG (Marker, VOID *);                                    \r
-  Delay    = (UINTN)VA_ARG (Marker, UINT64);                            \r
+  Delay    = VA_ARG (Marker, UINT64);\r
   //\r
   // According to the spec, the interval between 2 polls is 100ns,\r
   // but the unit of Duration for S3BootScriptSaveMemPoll() is microsecond(1000ns).\r
@@ -359,7 +359,7 @@ BootScriptWriteMemPoll (
   // Duration will be minimum 1(microsecond) to be minimum deviation,\r
   // so LoopTimes = Delay / 10.\r
   //\r
-  LoopTimes = (UINTN) DivU64x32Remainder (\r
+  LoopTimes = DivU64x32Remainder (\r
                 Delay,\r
                 10,\r
                 &Remainder\r