From patchwork Wed Mar 27 04:40:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1066453 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PX20gHqB"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44Tb1D2Sqlz9sNk for ; Wed, 27 Mar 2019 15:41:20 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C6E83C21DFB; Wed, 27 Mar 2019 04:40:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 54C83C21E50; Wed, 27 Mar 2019 04:39:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9F875C21E34; Wed, 27 Mar 2019 04:39:26 +0000 (UTC) Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) by lists.denx.de (Postfix) with ESMTPS id ABC68C21E50 for ; Wed, 27 Mar 2019 04:39:22 +0000 (UTC) Received: by mail-yw1-f66.google.com with SMTP id j128so11543264ywg.12 for ; Tue, 26 Mar 2019 21:39:22 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=UadYXf+fYjPAyxYVrydlV6RLBFyXvBE+TbGog072Yb0=; b=PX20gHqBQWwZxpM98GyHmhHA/pWP4+83DFn18fsRpoTvYFVlpyXF3upN3Bg0BfKy+H g0/F5/7M6/7yKaMJR2qTO8MKmbqCTdKBEpfelBPvRUUvqEiNZc9D+3UP7g88eIujFYAG 8SyMVNLzx1zSF4yjh4eP3zdxUcUl5pcr2O2SDydnjvKs19AyeBqJF5uDA6bqhRyeqQRW OjG5k/i1vTNsi7PcYpLgDWOC2JQLHtcaXw702l6colbllLTAZAQw4c6ezLxN3cXMSFPy eQCIKzm+330BGoc9vymguaguupPZtU8d6Vf5abJJqv8Vhxpro6CIknpAbRyOerzGVlRp ux1w== 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:mime-version:content-transfer-encoding; bh=UadYXf+fYjPAyxYVrydlV6RLBFyXvBE+TbGog072Yb0=; b=jHNd9FdAQJtx/4lr6iK+/p5S6SoOKM7BsBe5yLHdiTuAHiIi/de9h0uc/UK63s2exc idCPkgsRDyHC/Mnhaono3HWP29i/poC8VAFaLchCi8kMil6y/N2yckfITMh5CW37JqdC AsB+Q/Bx57mHYrFbTqRS1CpBqohnpxLVBV7HVSXCPZaOOtNHjlezQkxG3OAcpT1eXcBH Kk8yn1CgY+PM/QE+Gg7m40xnFDA9dRETHul17CXieOEoOm3eVxmiGfyVcxGXQg5V0yU+ 3+IwJ3FZrKXTliAqG+PxZtYkfP+nVaDXvzNVA9RmoYw/e48fUdaxaQ3C6hfRmmKBFWOv AtwA== X-Gm-Message-State: APjAAAU8A3IOW0yFHM/skvoaIFAQVUfytH8pcB4kc2cbaqox7hO37opq F6LKJmvsp3wwQ3N+0u1RrKR24A== X-Google-Smtp-Source: APXvYqzVil6ylxlPFIVwgwJhJ6gvB64t9JIWMEiZ1v0kOmFJuxCXTndwgqUQSjClKyE6lcJIGrC2jg== X-Received: by 2002:a25:c382:: with SMTP id t124mr28491428ybf.157.1553661561691; Tue, 26 Mar 2019 21:39:21 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id a4sm880535ywa.7.2019.03.26.21.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 21:39:21 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Date: Wed, 27 Mar 2019 13:40:33 +0900 Message-Id: <20190327044042.13707-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190327044042.13707-1-takahiro.akashi@linaro.org> References: <20190327044042.13707-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [RFC v2 02/11] efi_loader: boottime: export efi_[un]load_image() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This is a preparatory patch. Those two functions will be used later for reworking do_bootefi(). Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 9 +++++++++ lib/efi_loader/efi_boottime.c | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 3f54e354bdcd..6dfa2fef3cf0 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -321,10 +321,19 @@ efi_status_t efi_create_handle(efi_handle_t *handle); void efi_delete_handle(efi_handle_t obj); /* Call this to validate a handle and find the EFI object for it */ struct efi_object *efi_search_obj(const efi_handle_t handle); +/* Load image */ +efi_status_t EFIAPI efi_load_image(bool boot_policy, + efi_handle_t parent_image, + struct efi_device_path *file_path, + void *source_buffer, + efi_uintn_t source_size, + efi_handle_t *image_handle); /* Start image */ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, efi_uintn_t *exit_data_size, u16 **exit_data); +/* Unload image */ +efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle); /* Find a protocol on a handle */ efi_status_t efi_search_protocol(const efi_handle_t handle, const efi_guid_t *protocol_guid, diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 578b32a05ffd..74da6b01054a 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1686,12 +1686,12 @@ error: * * Return: status code */ -static efi_status_t EFIAPI efi_load_image(bool boot_policy, - efi_handle_t parent_image, - struct efi_device_path *file_path, - void *source_buffer, - efi_uintn_t source_size, - efi_handle_t *image_handle) +efi_status_t EFIAPI efi_load_image(bool boot_policy, + efi_handle_t parent_image, + struct efi_device_path *file_path, + void *source_buffer, + efi_uintn_t source_size, + efi_handle_t *image_handle) { struct efi_device_path *dp, *fp; struct efi_loaded_image *info = NULL; @@ -1871,7 +1871,7 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle, * * Return: status code */ -static efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle) +efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle) { struct efi_object *efiobj;