MdeModulePkg/S3SaveState: Extract arguments in correct order

EFI_BOOT_SCRIPT_WRITE() interface is a var-arg interface.

Spec defines the order of parameters for
EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE as below:

  typedef
  EFI_STATUS
  (EFIAPI *EFI_BOOT_SCRIPT_WRITE) (
    IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
    IN UINT16 OpCode,
    IN EFI_BOOT_SCRIPT_WIDTH Width,
    IN UINT16 Segment,
    IN UINT64 Address,
    IN UINTN Count,
    IN VOID *Buffer
  );

But implementation assumes Segment is in the very end, after Buffer.
Similar spec/implementation gaps are also found for
EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE.

The patch fixes the implementation to extract the arguments in
correct order.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ruiyu Ni 2017-10-09 15:12:36 +08:00
parent fbe538450f
commit 0a274516ff
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Implementation for S3 Boot Script Saver state driver. Implementation for S3 Boot Script Saver state driver.
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions are licensed and made available under the terms and conditions
@ -210,10 +210,10 @@ BootScriptWritePciCfg2Write (
UINT16 Segment; UINT16 Segment;
Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);
Segment = VA_ARG (Marker, UINT16);
Address = VA_ARG (Marker, UINT64); Address = VA_ARG (Marker, UINT64);
Count = VA_ARG (Marker, UINTN); Count = VA_ARG (Marker, UINTN);
Buffer = VA_ARG (Marker, UINT8 *); Buffer = VA_ARG (Marker, UINT8 *);
Segment = VA_ARG (Marker, UINT16);
return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buffer); return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buffer);
} }
@ -240,8 +240,8 @@ BootScriptWritePciCfg2ReadWrite (
UINT8 *DataMask; UINT8 *DataMask;
Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);
Address = VA_ARG (Marker, UINT64);
Segment = VA_ARG (Marker, UINT16); Segment = VA_ARG (Marker, UINT16);
Address = VA_ARG (Marker, UINT64);
Data = VA_ARG (Marker, UINT8 *); Data = VA_ARG (Marker, UINT8 *);
DataMask = VA_ARG (Marker, UINT8 *); DataMask = VA_ARG (Marker, UINT8 *);

View File

@ -1,7 +1,7 @@
/** @file /** @file
Implementation for S3 SMM Boot Script Saver state driver. Implementation for S3 SMM Boot Script Saver state driver.
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions are licensed and made available under the terms and conditions
@ -209,10 +209,10 @@ BootScriptWritePciCfg2Write (
UINT16 Segment; UINT16 Segment;
Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);
Segment = VA_ARG (Marker, UINT16);
Address = VA_ARG (Marker, UINT64); Address = VA_ARG (Marker, UINT64);
Count = VA_ARG (Marker, UINTN); Count = VA_ARG (Marker, UINTN);
Buffer = VA_ARG (Marker, UINT8 *); Buffer = VA_ARG (Marker, UINT8 *);
Segment = VA_ARG (Marker, UINT16);
return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buffer); return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buffer);
} }
@ -239,8 +239,8 @@ BootScriptWritePciCfg2ReadWrite (
UINT8 *DataMask; UINT8 *DataMask;
Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);
Address = VA_ARG (Marker, UINT64);
Segment = VA_ARG (Marker, UINT16); Segment = VA_ARG (Marker, UINT16);
Address = VA_ARG (Marker, UINT64);
Data = VA_ARG (Marker, UINT8 *); Data = VA_ARG (Marker, UINT8 *);
DataMask = VA_ARG (Marker, UINT8 *); DataMask = VA_ARG (Marker, UINT8 *);