From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.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 6E07721194864 for ; Thu, 22 Nov 2018 09:55:14 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4FA230016F5; Thu, 22 Nov 2018 17:55:13 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-200.rdu2.redhat.com [10.10.120.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AF9B5D763; Thu, 22 Nov 2018 17:55:12 +0000 (UTC) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, thomas.abraham@arm.com, nariman.poushin@linaro.org, philmd@redhat.com References: <20181122172645.20819-1-ard.biesheuvel@linaro.org> <20181122172645.20819-3-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: Date: Thu, 22 Nov 2018 18:55:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181122172645.20819-3-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 22 Nov 2018 17:55:14 +0000 (UTC) Subject: Re: [PATCH edk2-platforms 2/4] Platform/ARM/BdsLid: drop unused BdsStartEfiApplication () X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:55:14 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/22/18 18:26, Ard Biesheuvel wrote: > To prevent having to fix it, let's drop BdsStartEfiApplication > entirely since it is never used. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > Platform/ARM/Include/Library/BdsLib.h | 19 ------- > Platform/ARM/Library/BdsLib/BdsFilePath.c | 58 -------------------- > 2 files changed, 77 deletions(-) > > diff --git a/Platform/ARM/Include/Library/BdsLib.h b/Platform/ARM/Include/Library/BdsLib.h > index 4528c2e8739b..23f777d4097d 100644 > --- a/Platform/ARM/Include/Library/BdsLib.h > +++ b/Platform/ARM/Include/Library/BdsLib.h > @@ -140,25 +140,6 @@ BootOptionAllocateBootIndex ( > VOID > ); > > -/** > - Start an EFI Application from a Device Path > - > - @param ParentImageHandle Handle of the calling image > - @param DevicePath Location of the EFI Application > - > - @retval EFI_SUCCESS All drivers have been connected > - @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found > - @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results. > - > -**/ > -EFI_STATUS > -BdsStartEfiApplication ( > - IN EFI_HANDLE ParentImageHandle, > - IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, > - IN UINTN LoadOptionsSize, > - IN VOID* LoadOptions > - ); > - > EFI_STATUS > BdsLoadImage ( > IN EFI_DEVICE_PATH *DevicePath, > diff --git a/Platform/ARM/Library/BdsLib/BdsFilePath.c b/Platform/ARM/Library/BdsLib/BdsFilePath.c > index 7a4a5052a786..67dafa4f3651 100644 > --- a/Platform/ARM/Library/BdsLib/BdsFilePath.c > +++ b/Platform/ARM/Library/BdsLib/BdsFilePath.c > @@ -1353,61 +1353,3 @@ BdsLoadImage ( > { > return BdsLoadImageAndUpdateDevicePath (&DevicePath, Type, Image, FileSize); > } > - > -/** > - Start an EFI Application from a Device Path > - > - @param ParentImageHandle Handle of the calling image > - @param DevicePath Location of the EFI Application > - > - @retval EFI_SUCCESS All drivers have been connected > - @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found > - @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results. > - > -**/ > -EFI_STATUS > -BdsStartEfiApplication ( > - IN EFI_HANDLE ParentImageHandle, > - IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, > - IN UINTN LoadOptionsSize, > - IN VOID* LoadOptions > - ) > -{ > - EFI_STATUS Status; > - EFI_HANDLE ImageHandle; > - EFI_PHYSICAL_ADDRESS BinaryBuffer; > - UINTN BinarySize; > - EFI_LOADED_IMAGE_PROTOCOL* LoadedImage; > - > - // Find the nearest supported file loader > - Status = BdsLoadImageAndUpdateDevicePath (&DevicePath, AllocateAnyPages, &BinaryBuffer, &BinarySize); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - // Load the image from the Buffer with Boot Services function > - Status = gBS->LoadImage (TRUE, ParentImageHandle, DevicePath, (VOID*)(UINTN)BinaryBuffer, BinarySize, &ImageHandle); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - // Passed LoadOptions to the EFI Application > - if (LoadOptionsSize != 0) { > - Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - LoadedImage->LoadOptionsSize = LoadOptionsSize; > - LoadedImage->LoadOptions = LoadOptions; > - } > - > - // Before calling the image, enable the Watchdog Timer for the 5 Minute period > - gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL); > - // Start the image > - Status = gBS->StartImage (ImageHandle, NULL, NULL); > - // Clear the Watchdog Timer after the image returns > - gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL); > - > - return Status; > -} > Makes sense; first we import BdsLib.h, then fix it up together with the (sole) lib instance. Reviewed-by: Laszlo Ersek