From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on0601.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::601]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90AC421A04811 for ; Tue, 11 Apr 2017 04:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QHWSL0+Hi/n2ItcwNiBpUAgF6xep5I2+q68bRpmewPU=; b=q8rA6fBfaor5uOCDp7K/FPjAckXymnwoX49Xsh+y8/QJ1/iKQK/dg9JUwHjhhqgAxrgw6JvI7PFDb+gA1PFfs4Od46ho1LZpHD/zpCTNPXev9057ZMaQHuj8icoIw/3pDyHbhIgs6JTJP0waMeuFJg/fBXBdg9Lc9QeahM5OrUQ= Received: from AM4PR0801MB1444.eurprd08.prod.outlook.com (10.168.5.24) by AM4PR0801MB1444.eurprd08.prod.outlook.com (10.168.5.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Tue, 11 Apr 2017 11:18:18 +0000 Received: from AM4PR0801MB1444.eurprd08.prod.outlook.com ([fe80::48aa:be0b:152c:b3ae]) by AM4PR0801MB1444.eurprd08.prod.outlook.com ([fe80::48aa:be0b:152c:b3ae%14]) with mapi id 15.01.1019.025; Tue, 11 Apr 2017 11:18:17 +0000 From: Evan Lloyd To: "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" , "leif.lindholm@linaro.org" CC: "ryan.harkin@linaro.org" , "ard.biesheuvel@linaro.org" Thread-Topic: [edk2] [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on deprecared ARM BdsLib Thread-Index: AQHSsqQUfikhQRo/z0SzJhTDCfMHq6HABQHg Date: Tue, 11 Apr 2017 11:18:16 +0000 Message-ID: References: <20170411091434.22967-1-ard.biesheuvel@linaro.org> In-Reply-To: <20170411091434.22967-1-ard.biesheuvel@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.96.140] x-microsoft-exchange-diagnostics: 1; AM4PR0801MB1444; 7:auEymVPC7lNv5ttUZBpYIYXvNw9R1Ckhbhj5FsZo0IbUBAn3xehfxqVRrkdYEByyDMClv8WHuSIuKcNmamqwYn62jahUkCa/GXJYrgIJRJPoNlWnZN2ZqD1v+yZE4R/suGwuiiA6nK6gNV+euZlw/ViK1UjRnaAlFX8DASriMc3BBvpqK4OQWI2ATCmNO2vjKWYwmUzGOK/0zzGImlZG7+Xaql/2QcN4PdBkOV4Mb85FODReo8uC8CIuvlOzffEs0Jts66awG5rtd/HwFbha+L5WiPML72W7M+nF9tqQSQ/SR0n4GGo+KMn36TJaM/VQuD5f3NQnQElhGees4RmvnQ== x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-office365-filtering-correlation-id: 31884177-6481-480c-8110-08d480cc7458 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:AM4PR0801MB1444; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(162533806227266)(21532816269658); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:AM4PR0801MB1444; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0801MB1444; x-forefront-prvs: 0274272F87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(13464003)(3660700001)(2201001)(5660300001)(7696004)(2950100002)(86362001)(6506006)(102836003)(66066001)(229853002)(3846002)(6116002)(305945005)(8936002)(33656002)(74316002)(3280700002)(2906002)(7736002)(8676002)(81166006)(189998001)(38730400002)(6436002)(99286003)(55016002)(2501003)(6306002)(2900100001)(54906002)(9686003)(53936002)(5890100001)(5250100002)(53546009)(6246003)(25786009)(54356999)(50986999)(4326008)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0801MB1444; H:AM4PR0801MB1444.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2017 11:18:16.5091 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0801MB1444 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 11:18:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Minor typo in title: "deprecared" should probably be deprecated? -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard = Biesheuvel Sent: 11 April 2017 10:15 To: edk2-devel@lists.01.org; leif.lindholm@linaro.org Cc: ryan.harkin@linaro.org; ard.biesheuvel@linaro.org Subject: [edk2] [PATCH] ArmPlatformPkg/EblCmdLib: remove dependency on depr= ecared ARM BdsLib The EBL alternative shell depends indirectly on the deprecated ARM BdsLib v= ia EblCmdLib, which only uses a single helper function that can easily be c= loned. So clone it, and remove the dependency. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- 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 =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 Argv[0] - symboltable @@ -393,7 +440,7 @@ EblDevicePaths ( EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol; EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol; - BdsConnectAllDrivers(); + ConnectAllDrivers(); 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 [Protocols] -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.