From patchwork Sun Sep 10 13:22:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 812140 X-Patchwork-Delegate: agraf@suse.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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qwOKDZx7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xqsJG1rhpz9s7g for ; Sun, 10 Sep 2017 23:25:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EDC05C21DEB; Sun, 10 Sep 2017 13:24:31 +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=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 D085BC21F50; Sun, 10 Sep 2017 13:23:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4BC99C21E77; Sun, 10 Sep 2017 13:23:12 +0000 (UTC) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by lists.denx.de (Postfix) with ESMTPS id 12D8FC21E74 for ; Sun, 10 Sep 2017 13:23:03 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id 7so4190694qtz.3 for ; Sun, 10 Sep 2017 06:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HXdAp0zEVWe5zGXYEnjYmwjovDI2F9EsqoSyXMyoAsg=; b=qwOKDZx7bclzxNS+PAC3a8+AyoMki+pMAn9US8Uh/p2HKF3FUVorWmzEvlk0/4Dq2D 6wZd3n6WZTe6zEpLllJa7vGIbKPoJcPEEHQZ/La3Cjl75x6Eg/Q2WimJEikn68TTJ4Bd 2WyKBSNjzDnvLFM6QjtvOFuWjzB49wxwkB2xF9yocJoATQ4Bbq0Jq3eQu/ru0gc2BLRU w+ZaliqvYRS31WdmxQYrURXm86SMv2Ei90++XpR0K8hovNgIDH2M9bEmWnlh2LEOA/Gq 7fDUYytO0sKyWR1YPIY38J9hxXL6tSMRZuZvd8agSZO87G16Pdgs0WPjkK4QCM3/VPnr tLVw== 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=HXdAp0zEVWe5zGXYEnjYmwjovDI2F9EsqoSyXMyoAsg=; b=NAW/SdG2ndz8JGDTZNx5Cgq6MjkPiT3r0pZtNHhJoMFbX3IUlnT09FABI5fa+9weOs q/wz3a7jm5g653nDtulb4IXiWpcL+Bh1Jj97WAhyVUWiOM/9Xcdlnv10tDmXky3yvhw3 0qK+E1BeBakS3eLYLfzFAKdDJDVh4jUEPvjAAV1ZHB7sPsnVHAkCefoBxWTiNB6GWD7B Fbp3OVi9SQIu1CQI2oNoQtvmEd80UmWO2SvdgICmMYq27hx8EV3dtQe0fDa9AfqOO0QN AUk7frJVoV90hu5vnFlYoRHbYlpQm/tYMwYqCRwIL6DpOpUk8dPOWvE+ZaeNc5PgSJG0 cMQg== X-Gm-Message-State: AHPjjUiRRP8VVNpuFC2benvqLOUZFddaVOBRO9p2pmK0WiPfE7HExBxp LrRDKaCj9guwr5zZh8c= X-Google-Smtp-Source: AOwi7QATt6go53ntUUcBr21MSyQP85sstGzuYi9sMx6E0bC/sNyx5n7GN+3Y7lz9Ze5GzCWTwd3iaA== X-Received: by 10.200.2.141 with SMTP id p13mr4583429qtg.45.1505049781769; Sun, 10 Sep 2017 06:23:01 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id q52sm4543624qtc.12.2017.09.10.06.23.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 06:23:00 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 10 Sep 2017 09:22:27 -0400 Message-Id: <20170910132236.14318-7-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170910132236.14318-1-robdclark@gmail.com> References: <20170910132236.14318-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Leif Lindholm Subject: [U-Boot] [PATCH v1 06/12] efi_loader: start fleshing out efi_device_path_utilities 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Not complete, but enough for Shell.efi and SCT.efi. Signed-off-by: Rob Clark --- lib/efi_loader/efi_device_path_utilities.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/efi_loader/efi_device_path_utilities.c b/lib/efi_loader/efi_device_path_utilities.c index 4b97080f35..37b539e8ff 100644 --- a/lib/efi_loader/efi_device_path_utilities.c +++ b/lib/efi_loader/efi_device_path_utilities.c @@ -12,36 +12,40 @@ const efi_guid_t efi_guid_device_path_utilities_protocol = EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID; -static UINTN get_device_path_size(const struct efi_device_path *device_path) +static UINTN EFIAPI get_device_path_size(const struct efi_device_path *device_path) { + UINTN sz = 0; EFI_ENTRY("%p", device_path); - return EFI_EXIT(0); + /* size includes the END node: */ + if (device_path) + sz = efi_dp_size(device_path) + sizeof(struct efi_device_path); + return EFI_EXIT(sz); } -static struct efi_device_path *duplicate_device_path( +static struct efi_device_path * EFIAPI duplicate_device_path( const struct efi_device_path *device_path) { EFI_ENTRY("%p", device_path); - return EFI_EXIT(NULL); + return EFI_EXIT(efi_dp_dup(device_path)); } -static struct efi_device_path *append_device_path( +static struct efi_device_path * EFIAPI append_device_path( const struct efi_device_path *src1, const struct efi_device_path *src2) { EFI_ENTRY("%p, %p", src1, src2); - return EFI_EXIT(NULL); + return EFI_EXIT(efi_dp_append(src1, src2)); } -static struct efi_device_path *append_device_node( +static struct efi_device_path * EFIAPI append_device_node( const struct efi_device_path *device_path, const struct efi_device_path *device_node) { EFI_ENTRY("%p, %p", device_path, device_node); - return EFI_EXIT(NULL); + return EFI_EXIT(efi_dp_append_node(device_path, device_node)); } -static struct efi_device_path *append_device_path_instance( +static struct efi_device_path * EFIAPI append_device_path_instance( const struct efi_device_path *device_path, const struct efi_device_path *device_path_instance) { @@ -49,7 +53,7 @@ static struct efi_device_path *append_device_path_instance( return EFI_EXIT(NULL); } -static struct efi_device_path *get_next_device_path_instance( +static struct efi_device_path * EFIAPI get_next_device_path_instance( struct efi_device_path **device_path_instance, UINTN *device_path_instance_size) { @@ -57,14 +61,14 @@ static struct efi_device_path *get_next_device_path_instance( return EFI_EXIT(NULL); } -static struct efi_device_path *create_device_node( +static struct efi_device_path * EFIAPI create_device_node( uint8_t node_type, uint8_t node_sub_type, uint16_t node_length) { EFI_ENTRY("%u, %u, %u", node_type, node_sub_type, node_length); return EFI_EXIT(NULL); } -static bool is_device_path_multi_instance( +static bool EFIAPI is_device_path_multi_instance( const struct efi_device_path *device_path) { EFI_ENTRY("%p", device_path);