From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (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 401652095C3AC for ; Tue, 11 Apr 2017 02:22:03 -0700 (PDT) Received: by mail-wr0-x22a.google.com with SMTP id l28so35179985wre.0 for ; Tue, 11 Apr 2017 02:22:03 -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=GlZ/YeJhQ/sgl2p2SYdWLLeot+jo+GhwHp+bo+D+vMQ=; b=ielIAk+uU2iGsGSVRfLdjL/VpL3ed+Xr+kwKM+InZDnjg0sB0xC4ktAPNs2jfWtKhe PNgCgkhEwvzMAKfIs3+tbhs5CA7GMhgp2ssm1vpYBi+Uwvru0h29RfPVn9LYAbaJ/B74 YZxFwfy4mZ9W9mDK8H3c0yRBPi9da1Ks2ReqU= 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=GlZ/YeJhQ/sgl2p2SYdWLLeot+jo+GhwHp+bo+D+vMQ=; b=sposHVQB2mpjwZkWOqsZJz0Fpm+igMBDxLY00MMk6vt9v1yGCuWbPSfbPXqfNKa4bo 5zWJDZNscHiArK3jL9fIiv1+1EmDprAfqE89fxZXBlrWMucQP7fY7go4IAejMzyWOE29 kCOMq0zYcbM6nK3Amy/5Mt8ihav9/Q6T0zTPraOTIGp3lyS34HUBIeaYVKDNClyrwknW iifQKqXxW9tX84j/Xy4zRAHhKuLLqhxZyqV9UDsIOxK6pB2P6RHFhcYzAdegzNSjz0CQ 6SQ9tbMWK7+vfSfZ2XyTRXPKvjLEQ62tORtDgCDGdznWyrcA1gp26X3cc0ZXL5ZhG9z1 uF7g== X-Gm-Message-State: AFeK/H15TdXXK6YwGY+7Z4lBhRi0zZwErBy/30cKQ+ZcZMvSs+7Du/8tmQ/B/cLMUYMNYJjS X-Received: by 10.223.179.195 with SMTP id x3mr45350652wrd.80.1491902521406; Tue, 11 Apr 2017 02:22:01 -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 201sm1688094wmr.5.2017.04.11.02.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 02:22:00 -0700 (PDT) Date: Tue, 11 Apr 2017 10:21:58 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, ryan.harkin@linaro.org Message-ID: <20170411092158.GS1657@bivouac.eciton.net> References: <20170411091434.22967-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20170411091434.22967-1-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib 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: Tue, 11 Apr 2017 09:22:03 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 11, 2017 at 10:14:34AM +0100, Ard Biesheuvel wrote: > The EBL alternative shell depends indirectly on the deprecated ARM > BdsLib via EblCmdLib, which only uses a single helper function that > can easily be cloned. So clone it, and remove the dependency. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel Looks good, thanks! Reviewed-by: Leif Lindholm > --- > ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c | 49 +++++++++++++++++++- > ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf | 1 - > 2 files changed, 48 insertions(+), 2 deletions(-) > > diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c > index 4a5f2be3947e..5bcd750bf9f8 100644 > --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c > +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c > @@ -50,6 +50,53 @@ EblDumpFdt ( > ); > > /** > + Connect all DXE drivers > + > + @retval EFI_SUCCESS All drivers have been connected > + @retval EFI_NOT_FOUND No handles match the search. > + @retval EFI_OUT_OF_RESOURCES There is not resource pool memory to store the matching results. > + > +**/ > +STATIC > +EFI_STATUS > +ConnectAllDrivers ( > + VOID > + ) > +{ > + UINTN HandleCount, Index; > + EFI_HANDLE *HandleBuffer; > + EFI_STATUS Status; > + > + do { > + // Locate all the driver handles > + Status = gBS->LocateHandleBuffer ( > + AllHandles, > + NULL, > + NULL, > + &HandleCount, > + &HandleBuffer > + ); > + if (EFI_ERROR (Status)) { > + break; > + } > + > + // Connect every handles > + for (Index = 0; Index < HandleCount; Index++) { > + gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); > + } > + > + if (HandleBuffer != NULL) { > + FreePool (HandleBuffer); > + } > + > + // Check if new handles have been created after the start of the previous handles > + Status = gDS->Dispatch (); > + } while (!EFI_ERROR(Status)); > + > + return EFI_SUCCESS; > +} > + > +/** > Simple arm disassembler via a library > > Argv[0] - symboltable > @@ -393,7 +440,7 @@ EblDevicePaths ( > EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol; > EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol; > > - BdsConnectAllDrivers(); > + ConnectAllDrivers(); > > Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol); > if (EFI_ERROR (Status)) { > diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf > index c4b2ae1f6473..f33456abf3c2 100644 > --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf > +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf > @@ -51,7 +51,6 @@ [LibraryClasses] > ArmDisassemblerLib > PerformanceLib > TimerLib > - BdsLib > FdtLib > > [Protocols] > -- > 2.9.3 >