From patchwork Tue Mar 5 05:53:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1051623 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="FZ2+OAzh"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44D5dX1t3Sz9s3q for ; Tue, 5 Mar 2019 16:52:32 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id BAB56C21DCA; Tue, 5 Mar 2019 05:52:18 +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=RCVD_IN_DNSWL_NONE, 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 AC17EC21DE8; Tue, 5 Mar 2019 05:52:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 764A0C21DD4; Tue, 5 Mar 2019 05:51:56 +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 D607AC21E26 for ; Tue, 5 Mar 2019 05:51:52 +0000 (UTC) Received: by mail-yw1-f66.google.com with SMTP id x21so6057003ywx.11 for ; Mon, 04 Mar 2019 21:51:52 -0800 (PST) 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=xYiPgxSrNHNTHRrBP8ONZ8gMKJIb1jwuyLJUSyRjVLU=; b=FZ2+OAzh0K20tESdi9jkqknlE1bWaX2TVJHagHdfIkBUouGb04l4C0/tbaU88CBbr3 cv/IWny56xZ233Ari5VULsNC8pnqCzw0i8ld8e3AXgV9Bdemkdeu1zT0S8W7L4GsLyRs EWbodRgaYrM2AeSZ4iPGKm4QujH3O8JIa5/3DVe7v9GSsHYrc1K0V+3A8Ldr0uI/Rr1A o8GZLAPaASwjApG9QeutYuAAi0j8M/X2+zb7+UD+D149mPLbDMOF3SkHbhHbSoZEONmM ESebP6VdpYfgUUTg3/bvTcZBPLjrVVpY1tr8ld92xS0JVFHmw9uRNgwV9qlkTWCCEH9m ubUw== 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=xYiPgxSrNHNTHRrBP8ONZ8gMKJIb1jwuyLJUSyRjVLU=; b=HjWRHnQNi0+idp1/7EVXCIM9fE5LpB4zfRbKCmj4CUUEcUpGXoxFzG/MXMc4cMAx2r IAAHpk/cPjvl+fXDzQll5nYXi3hGhl3UltMvKcqE4DCOwJjGaAjkhP7pazLLVB8+egzX GfpfPVqqat/hrx3VNoSQ1WracA6ASdtTfXwVdmn9P6K2Ypr+WPxXfieuNBndf5VcuymO RrCT0EHRkvl8WBrorGNp2cPxkz9ek3v3DE8dHDTlABJ8NDBrXTukazAMqH/cFd9wEBLi nOu5D5iM7Y94li9Q/z1ig5Ztg2icT8UJvIXEwGFpa+lqW8qg73n1scxLWCxGxAfBhdy5 KS9w== X-Gm-Message-State: APjAAAUlqVjRwEdx0wfoBnCJc820Dd4kxE/5ej6huTWzNFgnz/g9X5cV Vrh/3EROWRdaiTaYutAg2RT8nA== X-Google-Smtp-Source: APXvYqx7yZJ2LdLoSLJ0f0oCIzyYQ17lLIAknm/5vBTviXTVTvdVXodA3FIMxLnXbXiFmUs3y242Vw== X-Received: by 2002:a81:3a81:: with SMTP id h123mr17672174ywa.412.1551765111862; Mon, 04 Mar 2019 21:51:51 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id g39sm3546145ywk.50.2019.03.04.21.51.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 21:51:51 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@suse.de Date: Tue, 5 Mar 2019 14:53:31 +0900 Message-Id: <20190305055337.3793-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190305055337.3793-1-takahiro.akashi@linaro.org> References: <20190305055337.3793-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [RFC 2/8] 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" Those two functions will be used later to re-implement do_bootefi_exec(). 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 512880ab8fbf..47a51ddc9406 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -320,10 +320,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 7bd9c0a952d4..c6991d353497 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1672,12 +1672,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;