From nobody Tue May 7 16:51:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 150753320189156.24306713801627; Mon, 9 Oct 2017 00:13:21 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D81CF21E781F0; Mon, 9 Oct 2017 00:09:53 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 372132095E537 for ; Mon, 9 Oct 2017 00:09:53 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 00:13:19 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.7]) by orsmga004.jf.intel.com with ESMTP; 09 Oct 2017 00:13:10 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,499,1500966000"; d="scan'208";a="136610638" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 9 Oct 2017 15:13:08 +0800 Message-Id: <20171009071308.297964-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 Subject: [edk2] [PATCH] MdeModulePkg/S3SaveState: Extract arguments in correct order X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Cc: Star Zeng Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c | 6 +++--- MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c b/Mde= ModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c index efc0ef9140..d73005156c 100644 --- a/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c +++ b/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveState.c @@ -1,7 +1,7 @@ /** @file Implementation for S3 Boot Script Saver state driver. =20 - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions @@ -210,10 +210,10 @@ BootScriptWritePciCfg2Write ( UINT16 Segment; =20 Width =3D VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); + Segment =3D VA_ARG (Marker, UINT16); Address =3D VA_ARG (Marker, UINT64); Count =3D VA_ARG (Marker, UINTN); Buffer =3D VA_ARG (Marker, UINT8 *); - Segment =3D VA_ARG (Marker, UINT16); =20 return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buf= fer); } @@ -240,8 +240,8 @@ BootScriptWritePciCfg2ReadWrite ( UINT8 *DataMask; =20 Width =3D VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); - Address =3D VA_ARG (Marker, UINT64); Segment =3D VA_ARG (Marker, UINT16); + Address =3D VA_ARG (Marker, UINT64); Data =3D VA_ARG (Marker, UINT8 *); DataMask =3D VA_ARG (Marker, UINT8 *); =20 diff --git a/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c b/= MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c index 0d1580dc35..f397db37fd 100644 --- a/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c +++ b/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.c @@ -1,7 +1,7 @@ /** @file Implementation for S3 SMM Boot Script Saver state driver. =20 - Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions @@ -209,10 +209,10 @@ BootScriptWritePciCfg2Write ( UINT16 Segment; =20 Width =3D VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); + Segment =3D VA_ARG (Marker, UINT16); Address =3D VA_ARG (Marker, UINT64); Count =3D VA_ARG (Marker, UINTN); Buffer =3D VA_ARG (Marker, UINT8 *); - Segment =3D VA_ARG (Marker, UINT16); =20 return S3BootScriptSavePciCfg2Write (Width, Segment, Address, Count, Buf= fer); } @@ -239,8 +239,8 @@ BootScriptWritePciCfg2ReadWrite ( UINT8 *DataMask; =20 Width =3D VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH); - Address =3D VA_ARG (Marker, UINT64); Segment =3D VA_ARG (Marker, UINT16); + Address =3D VA_ARG (Marker, UINT64); Data =3D VA_ARG (Marker, UINT8 *); DataMask =3D VA_ARG (Marker, UINT8 *); =20 --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel