From nobody Sat Nov 2 12:31:08 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 1490969691775704.4150191962092; Fri, 31 Mar 2017 07:14:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 51C4B21A0483B; Fri, 31 Mar 2017 07:14:50 -0700 (PDT) Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::22f]) (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 C131F21A04839 for ; Fri, 31 Mar 2017 07:14:46 -0700 (PDT) Received: by mail-wr0-x22f.google.com with SMTP id w11so107035551wrc.3 for ; Fri, 31 Mar 2017 07:14:46 -0700 (PDT) Received: from localhost.localdomain ([160.171.180.74]) by smtp.gmail.com with ESMTPSA id b42sm6908720wra.36.2017.03.31.07.14.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 07:14:44 -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:in-reply-to:references; bh=oci815GXPAFGsT4XnGr5teSS2muXRJzcPg9KzeY3gtk=; b=CTaDiQtkF01PRv25arJAqQv5IiirR7gGcxlzh2bT70HwQOkqEQ3RfGoyVfvhzb3nvE ffYuf4kztIWu3h3vbxjqvKT1xzUqZf5Ue3jX5UTCtTTRyIGzNwGzS6BJZb9+piGtRFWQ z98FFQe4CFbK/Ux1uNtJ/ewpdJtWTQl2DbD1Q= 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:in-reply-to :references; bh=oci815GXPAFGsT4XnGr5teSS2muXRJzcPg9KzeY3gtk=; b=kYea1kVXpjnbh1FqpGQDgNT+GffYX1hfac9l1FGmA3HhQoU6BMobSfIAaIo9mzkYcI pnaDPrr19RXO8vAVJKhfMLtWvgGXjOsSuCnTGBGIwpdjg6zreU6D6vV/hlDgWZtfgf4B 8L+zESztapi9T+cZ9x2dArWrZirvC+jZSqB0gFUkqgyU6l1rOvty9rOsRWJ+hJW2mMXB bdUkAmUkdy7pavA9Cwj8cdwlLHtkxnQRyAfK3goQfeV48tblYyNRrn29Ez6WoUDVni/x JFmdN2BobpXpYR+OuhvqJaUk5GFlYDXWfwnUB+ymou6vSq7N6C7qeWHSi+TuULfFvlyr uxJg== X-Gm-Message-State: AFeK/H1KqtS6fJclTGobvxZUGgofOclAhRLdrkbTpOpwX3kdKSeDifIsaG0g5kS5x3cgRIMe X-Received: by 10.223.170.216 with SMTP id i24mr3298946wrc.153.1490969685003; Fri, 31 Mar 2017 07:14:45 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ryan.harkin@linaro.org Date: Fri, 31 Mar 2017 15:14:26 +0100 Message-Id: <20170331141434.20810-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170331141434.20810-1-ard.biesheuvel@linaro.org> References: <20170331141434.20810-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 1/9] 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: , Cc: 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" 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. 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/ArmPlatfor= mPkg/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 =20 @@ -35,6 +34,63 @@ typedef VOID (*ELF_ENTRYPOINT)(UINTN arg0, UINTN arg1, UINTN arg2, UINTN arg3); =20 +STATIC +EFI_STATUS +ShutdownUefiBootServices ( + VOID + ) +{ + EFI_STATUS Status; + UINTN MemoryMapSize; + EFI_MEMORY_DESCRIPTOR *MemoryMap; + UINTN MapKey; + UINTN DescriptorSize; + UINT32 DescriptorVersion; + UINTN Pages; + + MemoryMap =3D NULL; + MemoryMapSize =3D 0; + Pages =3D 0; + + do { + Status =3D gBS->GetMemoryMap ( + &MemoryMapSize, + MemoryMap, + &MapKey, + &DescriptorSize, + &DescriptorVersion + ); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + + Pages =3D EFI_SIZE_TO_PAGES (MemoryMapSize) + 1; + MemoryMap =3D AllocatePages (Pages); + + // + // Get System MemoryMap + // + Status =3D gBS->GetMemoryMap ( + &MemoryMapSize, + MemoryMap, + &MapKey, + &DescriptorSize, + &DescriptorVersion + ); + } + + // Don't do anything between the GetMemoryMap() and ExitBootServices() + if (!EFI_ERROR(Status)) { + Status =3D gBS->ExitBootServices (gImageHandle, MapKey); + if (EFI_ERROR(Status)) { + FreePages (MemoryMap, Pages); + MemoryMap =3D NULL; + MemoryMapSize =3D 0; + } + } + } while (EFI_ERROR(Status)); + + return Status; +} + =20 STATIC EFI_STATUS --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel