From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 04 Mar 2024 20:09:04 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rhDgO-008daY-0b for lore@lore.pengutronix.de; Mon, 04 Mar 2024 20:09:04 +0100 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rhDgN-0003x9-23 for lore@pengutronix.de; Mon, 04 Mar 2024 20:09:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eXa+ROx7BOJ4e9mB5ySBIK/1AGL53I12xbY5plDqSYA=; b=xr2AfYfcJ0rF55ChvLLWv59zUh uzbKMwfONfxMpKage3r7g6rs+Za0qOgFHnJbGdBcMLzK9Z0kpyaEFR9OqZFptdepZC83tDYQLFcyO raEbvHEhVkp57sZm1FXfYxXmsTdR1XOiLEwtT669irnuvRsG5H9+yUgtNxxb497W6WjGxOigZRA0i oQYIX9B4iqP7KbSFDh9tpky5y3lRFlMGbk+5lwcCZELMl67ExEpBPwuwz0KnXeX+wEqHH9QuiXBho dC2Y8uiiH7HpflmqWU8B06FpeP1EtjBRjnJHCdn21N4U4O9JpQjEkdzenB67HouCuN/cTypOPtb2s 3qB5TGog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhDfl-0000000AM6a-2eWJ; Mon, 04 Mar 2024 19:08:25 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhDaT-0000000AILO-3Tcn for barebox@lists.infradead.org; Mon, 04 Mar 2024 19:03:01 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rhDaH-0006AL-2f; Mon, 04 Mar 2024 20:02:45 +0100 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhDaG-004PKI-I0; Mon, 04 Mar 2024 20:02:44 +0100 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1rhDYM-00Ed9V-0G; Mon, 04 Mar 2024 20:00:46 +0100 From: Ahmad Fatoum To: barebox@lists.infradead.org Cc: Ahmad Fatoum Date: Mon, 4 Mar 2024 19:59:52 +0100 Message-Id: <20240304190038.3486881-68-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304190038.3486881-1-a.fatoum@pengutronix.de> References: <20240304190038.3486881-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_110258_235075_34C6A87E X-CRM114-Status: GOOD ( 11.39 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-5.4 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH v2 067/113] efi: block: move definitions into header file X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) We will need these definitions for the EFI loader as well, so move them into a header. Signed-off-by: Ahmad Fatoum --- drivers/block/efi-block-io.c | 27 --------------------------- include/efi.h | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/block/efi-block-io.c b/drivers/block/efi-block-io.c index 810b6da32d55..876b46c2d7a7 100644 --- a/drivers/block/efi-block-io.c +++ b/drivers/block/efi-block-io.c @@ -19,33 +19,6 @@ #define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001 #define EFI_BLOCK_IO_PROTOCOL_REVISION3 ((2<<16) | (31)) -struct efi_block_io_media{ - u32 media_id; - bool removable_media; - bool media_present; - bool logical_partition; - bool read_only; - bool write_caching; - u32 block_size; - u32 io_align; - sector_t last_block; - u64 lowest_aligned_lba; /* added in Revision 2 */ - u32 logical_blocks_per_physical_block; /* added in Revision 2 */ - u32 optimal_transfer_length_granularity; /* added in Revision 3 */ -}; - -struct efi_block_io_protocol { - u64 revision; - struct efi_block_io_media *media; - efi_status_t(EFIAPI *reset)(struct efi_block_io_protocol *this, - bool ExtendedVerification); - efi_status_t(EFIAPI *read)(struct efi_block_io_protocol *this, u32 media_id, - u64 lba, unsigned long buffer_size, void *buf); - efi_status_t(EFIAPI *write)(struct efi_block_io_protocol *this, u32 media_id, - u64 lba, unsigned long buffer_size, void *buf); - efi_status_t(EFIAPI *flush)(struct efi_block_io_protocol *this); -}; - struct efi_bio_priv { struct efi_block_io_protocol *protocol; struct device *dev; diff --git a/include/efi.h b/include/efi.h index 18583bf62594..2e34c6be068a 100644 --- a/include/efi.h +++ b/include/efi.h @@ -655,6 +655,33 @@ __attribute__((noreturn)) void efi_main(efi_handle_t, struct efi_system_table *) */ #define EFI_VARIABLE_GUID_LEN 36 +struct efi_block_io_media{ + u32 media_id; + bool removable_media; + bool media_present; + bool logical_partition; + bool read_only; + bool write_caching; + u32 block_size; + u32 io_align; + sector_t last_block; + u64 lowest_aligned_lba; /* added in Revision 2 */ + u32 logical_blocks_per_physical_block; /* added in Revision 2 */ + u32 optimal_transfer_length_granularity; /* added in Revision 3 */ +}; + +struct efi_block_io_protocol { + u64 revision; + struct efi_block_io_media *media; + efi_status_t(EFIAPI *reset)(struct efi_block_io_protocol *this, + bool ExtendedVerification); + efi_status_t(EFIAPI *read)(struct efi_block_io_protocol *this, u32 media_id, + u64 lba, unsigned long buffer_size, void *buf); + efi_status_t(EFIAPI *write)(struct efi_block_io_protocol *this, u32 media_id, + u64 lba, unsigned long buffer_size, void *buf); + efi_status_t(EFIAPI *flush)(struct efi_block_io_protocol *this); +}; + struct simple_text_output_mode { s32 max_mode; s32 mode; -- 2.39.2