From patchwork Wed Jan 17 19:16:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 862521 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=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zMH785hrLz9t5Q for ; Thu, 18 Jan 2018 06:23:16 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5B408C21E37; Wed, 17 Jan 2018 19:20:48 +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_MSPIKE_H2 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 3B100C21E4A; Wed, 17 Jan 2018 19:16:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1FF2EC21E4B; Wed, 17 Jan 2018 19:16:29 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lists.denx.de (Postfix) with ESMTPS id 0489EC21E0C for ; Wed, 17 Jan 2018 19:16:24 +0000 (UTC) Received: from workstation4.fritz.box ([95.222.46.37]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MZCUG-1eH4Yd1ypA-00KzHh; Wed, 17 Jan 2018 20:16:23 +0100 From: Heinrich Schuchardt To: Alexander Graf Date: Wed, 17 Jan 2018 20:16:06 +0100 Message-Id: <20180117191612.17108-13-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180117191612.17108-1-xypron.glpk@gmx.de> References: <20180117191612.17108-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:ppKXjr1mbupu1UrOdjZJ1TpYbroBFcgFH9AJD8eRlAOxQ288EUK EfXEy7auFHFTtMQA7EdQphilflRFqS8fFK7Az78ozCZOj10TbB5ywmu6KUUjm/VtGCbDsCD DZSisUCJN3C1XHl2KUceve3TEOj5bxACHl7ojbu/XN8m/FUkoZ5wCZHl6Wgf+wZYXP0PAzJ 0OdQHIvQtYPAfDMEPdm5w== X-UI-Out-Filterresults: notjunk:1; V01:K0:v2yFVXwaMYI=:Z8w4vKYeA4GcNxqSTitVXS 9JvRr36/jFO+xphZlxH1X4zaf2EqLi/WhnqviW2MOoWgADw9z3dZKe0Cb5BFnORXxvz9xKRJl RYNN1RVABD8NnUFWM+hao/nkfuXnwpohwdeXb2OG2kCDAHejmRHyJfg7+esxv2Bi4KBw2NFgQ vgI4+QLgXOCuEbbgeZw6ikeY2Qzggoq3qlhUF192fPvop5cqOnsWDkAaytQUmOqShS7Jekan4 masrrySDYrCnhEa5gTdlZaKz3WwpJrXQnxiIEQu2boa/p06fkJrgGFgn1SD0+Zx1E50KXmdhL b0AiSNvQ9U7SVAmyljnGPlMX6U4+f+rFyzl4DY7lbeUc734/OgHmjhnifCxcEhxMPbeItrIOD wZ4Rlu1FKa7UQ62SeTQyyITZ3uMb/m5P6jzlotFIWonVyu8mx78BMB+juykL6F8ap+5dhIlmx T68OWZLVXurPzitloQZBFLEmzIfevIWDA5d9Pe6Bxn4Xqmgcs1sd8NtUYQZ5o9e3fiWeFZPl8 jxx7n/I7bFDQSkjhCfXC1dsEjeIb8ZxrRJ51umNvOF/6sWrtxbZ5groZu7uAygNYhAIo2cMQm JiRQNbdXgJHEJKGFrKT4HvRpCUFsWIZAQjXXuCtZA06m3kwdwc/K4iotr0lKG3VPqs1oKam5j T1j1DNBQ4cQBC/ZTbnBg9mLSr8jkA259sxQXD3ejr4A6PqylvLzkLHXOmj1IqG3xe28uvnoNx zOMs6vt32ISFrfJ1wxgivmBsB1LA6jJ6gbbcATsOtWRdoZnmd+ji6b7anKcUdWYd3tvh49lcT 9LVGJy7vNSE3GlemE9jNpVAKGb5Eg== Cc: Heinrich Schuchardt , Tom Rini , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 12/18] efi_loader: correct EFI_BLOCK_IO_PROTOCOL definitions 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" Add the revision constants. Depending on the revision additional fields are needed in the media descriptor. Use efi_uintn_t for number of bytes to read or write. Signed-off-by: Heinrich Schuchardt --- v2 no change --- include/efi_api.h | 10 ++++++++-- lib/efi_loader/efi_disk.c | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index 502fffed20..0bc244444d 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -424,18 +424,24 @@ struct efi_block_io_media u32 io_align; u8 pad2[4]; u64 last_block; + u64 lowest_aligned_lba; + u32 logical_blocks_per_physical_block; + u32 optimal_transfer_length_granualarity; }; +#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001 +#define EFI_BLOCK_IO_PROTOCOL_REVISION3 0x0002001f + struct efi_block_io { u64 revision; struct efi_block_io_media *media; efi_status_t (EFIAPI *reset)(struct efi_block_io *this, char extended_verification); efi_status_t (EFIAPI *read_blocks)(struct efi_block_io *this, - u32 media_id, u64 lba, unsigned long buffer_size, + u32 media_id, u64 lba, efi_uintn_t buffer_size, void *buffer); efi_status_t (EFIAPI *write_blocks)(struct efi_block_io *this, - u32 media_id, u64 lba, unsigned long buffer_size, + u32 media_id, u64 lba, efi_uintn_t buffer_size, void *buffer); efi_status_t (EFIAPI *flush_blocks)(struct efi_block_io *this); }; diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 92c3f45ca5..8f84e7788e 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -91,7 +91,7 @@ static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this, } static efi_status_t EFIAPI efi_disk_read_blocks(struct efi_block_io *this, - u32 media_id, u64 lba, unsigned long buffer_size, + u32 media_id, u64 lba, efi_uintn_t buffer_size, void *buffer) { void *real_buffer = buffer; @@ -112,7 +112,7 @@ static efi_status_t EFIAPI efi_disk_read_blocks(struct efi_block_io *this, real_buffer = efi_bounce_buffer; #endif - EFI_ENTRY("%p, %x, %"PRIx64", %lx, %p", this, media_id, lba, + EFI_ENTRY("%p, %x, %" PRIx64 ", %zx, %p", this, media_id, lba, buffer_size, buffer); r = efi_disk_rw_blocks(this, media_id, lba, buffer_size, real_buffer, @@ -126,7 +126,7 @@ static efi_status_t EFIAPI efi_disk_read_blocks(struct efi_block_io *this, } static efi_status_t EFIAPI efi_disk_write_blocks(struct efi_block_io *this, - u32 media_id, u64 lba, unsigned long buffer_size, + u32 media_id, u64 lba, efi_uintn_t buffer_size, void *buffer) { void *real_buffer = buffer; @@ -147,7 +147,7 @@ static efi_status_t EFIAPI efi_disk_write_blocks(struct efi_block_io *this, real_buffer = efi_bounce_buffer; #endif - EFI_ENTRY("%p, %x, %"PRIx64", %lx, %p", this, media_id, lba, + EFI_ENTRY("%p, %x, %" PRIx64 ", %zx, %p", this, media_id, lba, buffer_size, buffer); /* Populate bounce buffer if necessary */