From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x234.google.com (mail-wr0-x234.google.com [IPv6:2a00:1450:400c:c0c::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 12BBF21A04811 for ; Wed, 5 Apr 2017 07:56:41 -0700 (PDT) Received: by mail-wr0-x234.google.com with SMTP id t20so18660466wra.1 for ; Wed, 05 Apr 2017 07:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=C0iGNeu4Zd5a/qDsVOj20E0QnAa28O996v+4ZeqOh5U=; b=gZ++X2HAqDZJUkZQwcKB1XLu7KNmwWG1Vf72HeRb33ODup9toC8frkCyN+o2jUdO70 qcQav2+UiNdBjQ7XmHd0Bw9Uxv6cZ8jcNyB/q345+D9Wne/Ps/CzeiO31PHFG0qb+xId VxSrBXeXjfwdp0pNwyY8ET6cAEEZKXHyB8Uq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=C0iGNeu4Zd5a/qDsVOj20E0QnAa28O996v+4ZeqOh5U=; b=Ed/DRy55XHKjxS2yo57IpbbDIH82nhTm5bsqz60TZ+TpHwCdmwQC+t8krs+ic7eAlL eQWJZVS8HxHKXT/O+XRq9ZA+ZCHhQoG7J3/yZz0cwTuLe2I3gaI1MQ8C1tfpxvYpIipf YciQ2sHTa3kayKpG6B/HF6/ULj5lKj4QMfiUa5H0u6fMVQzQmbkPUWnqYy7S1dKMAHkW 6CQvZpmtq28s/aDqKti5bQJyi5l8fZI5RJ3qY7qehPVcQMMcrDDtdht2br+B1+AUBPj+ miBB1KBBKPYRA7OL7yPFfe8OI//3p9/bFn9BGTyuVCWa2Bt14DbjAn2dtLe8TqK/zK28 Nfpg== X-Gm-Message-State: AFeK/H1TDRmcoej8jvmAxiL85Cjm5XIpTOPGXlrqw/osnxULge9mCGZvd9i0K+wqwP1hOvUz X-Received: by 10.223.150.35 with SMTP id b32mr2717570wra.78.1491404199575; Wed, 05 Apr 2017 07:56:39 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id e23sm18320586wmi.16.2017.04.05.07.56.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 07:56:38 -0700 (PDT) Date: Wed, 5 Apr 2017 15:56:36 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Ryan Harkin Message-ID: <20170405145636.GN25239@bivouac.eciton.net> References: <20170404123010.11722-1-ard.biesheuvel@linaro.org> <20170404123010.11722-2-ard.biesheuvel@linaro.org> <20170405130946.GC25239@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH v3 1/6] ArmPlatformPkg/ArmShellCmdRunAxf: remove BdsLib dependency 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: , X-List-Received-Date: Wed, 05 Apr 2017 14:56:41 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 05, 2017 at 02:11:44PM +0100, Ard Biesheuvel wrote: > On 5 April 2017 at 14:09, Leif Lindholm wrote: > > On Tue, Apr 04, 2017 at 01:30:05PM +0100, Ard Biesheuvel wrote: > >> Remove ArmShellCmdRunAxf's dependency on the deprecated BdsLib by > >> cloning the ShutdownUefiBootServices() routine into a local source > >> file; this is the only BdsLib feature 'runaxf' depends on. > > > > I was going to go through these individually and give a R-b for the > > whole series at the end if I didn't come across anything, but I'd just > > like to add for this one: > > > > This is abslutely the right thing to do - BdsLib only had this > > functionality due to the LinuxLoader, and it could be deleted now (but > > I guess we're planning to get rid of the whole thing?). > > > > I'd like to avoid doing any 'improvements' to BdsLib while it's on its > way you -- once AndroidFastBootApp is the last remaining user, we can > fold whatever it uses into it instead. Agreed - thanks! / Leif > > Reviewed-by: Leif Lindholm > > > > Thanks > > >> > >> Contributed-under: TianoCore Contribution Agreement 1.0 > >> Signed-off-by: Ard Biesheuvel > >> --- > >> ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf | 1 - > >> ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c | 58 +++++++++++++++++++- > >> 2 files changed, 57 insertions(+), 2 deletions(-) > >> > >> diff --git a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf > >> index 9a34f666612a..7d15f6934608 100644 > >> --- a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf > >> +++ b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf > >> @@ -43,7 +43,6 @@ [Packages] > >> [LibraryClasses] > >> ArmLib > >> BaseLib > >> - BdsLib > >> DebugLib > >> HiiLib > >> ShellLib > >> diff --git a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c > >> index 2abfb6cc1053..9f4fc780307d 100644 > >> --- a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c > >> +++ b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/RunAxf.c > >> @@ -21,7 +21,6 @@ > >> #include > >> #include > >> #include > >> -#include > >> #include > >> #include > >> > >> @@ -35,6 +34,63 @@ > >> typedef VOID (*ELF_ENTRYPOINT)(UINTN arg0, UINTN arg1, > >> UINTN arg2, UINTN arg3); > >> > >> +STATIC > >> +EFI_STATUS > >> +ShutdownUefiBootServices ( > >> + VOID > >> + ) > >> +{ > >> + EFI_STATUS Status; > >> + UINTN MemoryMapSize; > >> + EFI_MEMORY_DESCRIPTOR *MemoryMap; > >> + UINTN MapKey; > >> + UINTN DescriptorSize; > >> + UINT32 DescriptorVersion; > >> + UINTN Pages; > >> + > >> + MemoryMap = NULL; > >> + MemoryMapSize = 0; > >> + Pages = 0; > >> + > >> + do { > >> + Status = gBS->GetMemoryMap ( > >> + &MemoryMapSize, > >> + MemoryMap, > >> + &MapKey, > >> + &DescriptorSize, > >> + &DescriptorVersion > >> + ); > >> + if (Status == EFI_BUFFER_TOO_SMALL) { > >> + > >> + Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1; > >> + MemoryMap = AllocatePages (Pages); > >> + > >> + // > >> + // Get System MemoryMap > >> + // > >> + Status = gBS->GetMemoryMap ( > >> + &MemoryMapSize, > >> + MemoryMap, > >> + &MapKey, > >> + &DescriptorSize, > >> + &DescriptorVersion > >> + ); > >> + } > >> + > >> + // Don't do anything between the GetMemoryMap() and ExitBootServices() > >> + if (!EFI_ERROR(Status)) { > >> + Status = gBS->ExitBootServices (gImageHandle, MapKey); > >> + if (EFI_ERROR(Status)) { > >> + FreePages (MemoryMap, Pages); > >> + MemoryMap = NULL; > >> + MemoryMapSize = 0; > >> + } > >> + } > >> + } while (EFI_ERROR(Status)); > >> + > >> + return Status; > >> +} > >> + > >> > >> STATIC > >> EFI_STATUS > >> -- > >> 2.9.3 > >>