From patchwork Tue May 17 19:59:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 68010 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2264015qge; Tue, 17 May 2016 12:59:37 -0700 (PDT) X-Received: by 10.66.148.230 with SMTP id tv6mr4787631pab.89.1463515176929; Tue, 17 May 2016 12:59:36 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id t8si6503014pfi.200.2016.05.17.12.59.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 May 2016 12:59:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 14B551A1FFA; Tue, 17 May 2016 12:59:40 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 043041A1FF8 for ; Tue, 17 May 2016 12:59:39 -0700 (PDT) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9B2C7F6B0; Tue, 17 May 2016 19:59:33 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-87.phx2.redhat.com [10.3.116.87]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4HJxKuN022941; Tue, 17 May 2016 15:59:32 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 17 May 2016 21:59:15 +0200 Message-Id: <1463515156-26780-6-git-send-email-lersek@redhat.com> In-Reply-To: <1463515156-26780-1-git-send-email-lersek@redhat.com> References: <1463515156-26780-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 17 May 2016 19:59:33 +0000 (UTC) Subject: [edk2] [PATCH 5/6] OvmfPkg, ArmVirtPkg: clean up SetBootOrderFromQemu() parameter list X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Jordan Justen , Gary Ching-Pang Lin , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" With OvmfPkg's original QemuBootOrderLib (and USE_OLD_BDS) gone, we no longer need the BootOptionList parameter in the SetBootOrderFromQemu() prototype. Update the library class header file (including the function's documentation), and adapt the library instance and the call sites. Cc: Ard Biesheuvel Cc: Gary Ching-Pang Lin Cc: Jordan Justen Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Include/Library/QemuBootOrderLib.h | 11 +++++------ ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 2 +- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 2 +- OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c | 20 +++++--------------- 4 files changed, 12 insertions(+), 23 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/OvmfPkg/Include/Library/QemuBootOrderLib.h b/OvmfPkg/Include/Library/QemuBootOrderLib.h index 80d02c80c260..743a71782471 100644 --- a/OvmfPkg/Include/Library/QemuBootOrderLib.h +++ b/OvmfPkg/Include/Library/QemuBootOrderLib.h @@ -26,12 +26,11 @@ Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the OpenFirmware device paths therein to UEFI device path fragments. Match the - translated fragments against BootOptionList, and rewrite the BootOrder NvVar - so that it corresponds to the order described in fw_cfg. - - @param[in] BootOptionList A boot option list, created with - BdsLibEnumerateAllBootOption (). + translated fragments against the current list of boot options, and rewrite + the BootOrder NvVar so that it corresponds to the order described in fw_cfg. + Platform BDS should call this function after EfiBootManagerConnectAll () and + EfiBootManagerRefreshAllBootOption () return. @retval RETURN_SUCCESS BootOrder NvVar rewritten. @@ -51,7 +50,7 @@ **/ RETURN_STATUS SetBootOrderFromQemu ( - IN CONST LIST_ENTRY *BootOptionList + VOID ); diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c index d4bfcd0c0715..cc6d21e30007 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -551,7 +551,7 @@ PlatformBootManagerAfterConsole ( // the QEMU configuration. // EfiBootManagerRefreshAllBootOption (); - SetBootOrderFromQemu (NULL); + SetBootOrderFromQemu (); } /** diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index a16453d289de..da4cb728c678 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -1305,7 +1305,7 @@ Routine Description: PcdGetPtr (PcdShellFile), L"EFI Internal Shell", LOAD_OPTION_ACTIVE ); - SetBootOrderFromQemu (NULL); + SetBootOrderFromQemu (); } /** diff --git a/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c index c5f165ae4e23..86082301a8f5 100644 --- a/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c +++ b/OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c @@ -1696,12 +1696,11 @@ PruneBootVariables ( Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the OpenFirmware device paths therein to UEFI device path fragments. Match the - translated fragments against BootOptionList, and rewrite the BootOrder NvVar - so that it corresponds to the order described in fw_cfg. - - @param[in] BootOptionList A boot option list, created with - BdsLibEnumerateAllBootOption (). + translated fragments against the current list of boot options, and rewrite + the BootOrder NvVar so that it corresponds to the order described in fw_cfg. + Platform BDS should call this function after EfiBootManagerConnectAll () and + EfiBootManagerRefreshAllBootOption () return. @retval RETURN_SUCCESS BootOrder NvVar rewritten. @@ -1721,7 +1720,7 @@ PruneBootVariables ( **/ RETURN_STATUS SetBootOrderFromQemu ( - IN CONST LIST_ENTRY *BootOptionList + VOID ) { RETURN_STATUS Status; @@ -1741,15 +1740,6 @@ SetBootOrderFromQemu ( EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions; UINTN BootOptionCount; - // - // The QemuBootOrderLib is linked by OvmfPkg and ArmVirtPkg. - // OvmfPkg was changed to use the new BDS @ MdeModulePkg, so boot options - // are no longer stored in linked list. - // But we don't change the QemuBootOrderLib class interface because - // ArmVirtPkg are still using old BDS @ IntelFrameworkModulePkg. - // - ASSERT (BootOptionList == NULL); - Status = QemuFwCfgFindFile ("bootorder", &FwCfgItem, &FwCfgSize); if (Status != RETURN_SUCCESS) { return Status;