From nobody Thu May 2 12:10:23 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zoho.com; dkim=fail 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 1491902087587861.7270203231053; Tue, 11 Apr 2017 02:14:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A0CB521939304; Tue, 11 Apr 2017 02:14:45 -0700 (PDT) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 6190721939304 for ; Tue, 11 Apr 2017 02:14:43 -0700 (PDT) Received: by mail-wm0-x235.google.com with SMTP id o81so57981192wmb.1 for ; Tue, 11 Apr 2017 02:14:43 -0700 (PDT) Received: from localhost.localdomain ([196.85.182.219]) by smtp.gmail.com with ESMTPSA id h16sm892044wrc.22.2017.04.11.02.14.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 02:14:40 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=PHG57UkWVoGxXhk7QCGYG2KyNnRgzYOrXhuF3MJO2/s=; b=MRzL5fxg126D8Tij4sFy9+W/vu4F6Z0xiGvlzf/Mq8RahgdZTpkeSId4cz326RDTTQ pCZi51LksG9zDxQwPkoG9/ruzM18Nh5x2yMuSn6YpXfC2mIkT9TD7cg4ZMqS+PfYH+Fq Q7zR0iz/ozTNNBWpMq5sQ+0NPPQJa/ROH2ZlQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PHG57UkWVoGxXhk7QCGYG2KyNnRgzYOrXhuF3MJO2/s=; b=t8eG/0cPwPwbEN8VjquV/e4xR+pWLD9fBYne7iwp8v9i7NpreO6Cxlm47Os4kFrUGG ZZzTZsZGArHmfV0Xl8aPy5kQyRSRlSZqluctFHXoIAUF1Npw6yL0WSeiX3+uGtpjhvXm huCHrFqiycmkocfiSG0mO4zRUC68GpxHAavf6Uqkla33qCMkALwgX04J25zcE1Le4LFG UdOdz3fZARIhT8j+RZQXozRz6aHa9V/faSTT43dHKp9bKpKYJQdPXiM7ppl5oTBL/FVG 6DhzNv56omB3H/pVy8JQ/o1zoiBF/24pjxuOcvqAro7oRngS9CdNDXhBRW8S2ExAb7Gh gMgA== X-Gm-Message-State: AN3rC/5IRbW7firvjjTZeg9Oq1xfSVbtmV7b1ohWwR6CoGV0BRNJ1N8x RyDCLLHjesw9wslm X-Received: by 10.28.234.205 with SMTP id g74mr14363098wmi.13.1491902081727; Tue, 11 Apr 2017 02:14:41 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Tue, 11 Apr 2017 10:14:34 +0100 Message-Id: <20170411091434.22967-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [edk2] [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: , Cc: ryan.harkin@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 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 ( ); =20 /** + 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 =3D gBS->LocateHandleBuffer ( + AllHandles, + NULL, + NULL, + &HandleCount, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + break; + } + + // Connect every handles + for (Index =3D 0; Index < HandleCount; Index++) { + gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); + } + + if (HandleBuffer !=3D NULL) { + FreePool (HandleBuffer); + } + + // Check if new handles have been created after the start of the previ= ous handles + Status =3D gDS->Dispatch (); + } while (!EFI_ERROR(Status)); + + return EFI_SUCCESS; +} + +/** Simple arm disassembler via a library =20 Argv[0] - symboltable @@ -393,7 +440,7 @@ EblDevicePaths ( EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol; EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol; =20 - BdsConnectAllDrivers(); + ConnectAllDrivers(); =20 Status =3D gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, = (VOID **)&DevicePathToTextProtocol); if (EFI_ERROR (Status)) { diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPk= g/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 =20 [Protocols] --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel