summaryrefslogtreecommitdiffstats
path: root/src/boot/efi/proto/block-io.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
commit55944e5e40b1be2afc4855d8d2baf4b73d1876b5 (patch)
tree33f869f55a1b149e9b7c2b7e201867ca5dd52992 /src/boot/efi/proto/block-io.h
parentInitial commit. (diff)
downloadsystemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.tar.xz
systemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.zip
Adding upstream version 255.4.upstream/255.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boot/efi/proto/block-io.h')
-rw-r--r--src/boot/efi/proto/block-io.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/boot/efi/proto/block-io.h b/src/boot/efi/proto/block-io.h
new file mode 100644
index 0000000..e977f70
--- /dev/null
+++ b/src/boot/efi/proto/block-io.h
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "efi.h"
+
+#define EFI_BLOCK_IO_PROTOCOL_GUID \
+ GUID_DEF(0x0964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
+
+typedef struct EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL;
+struct EFI_BLOCK_IO_PROTOCOL {
+ uint64_t Revision;
+ struct {
+ uint32_t MediaId;
+ bool RemovableMedia;
+ bool MediaPresent;
+ bool LogicalPartition;
+ bool ReadOnly;
+ bool WriteCaching;
+ uint32_t BlockSize;
+ uint32_t IoAlign;
+ EFI_LBA LastBlock;
+ EFI_LBA LowestAlignedLba;
+ uint32_t LogicalBlocksPerPhysicalBlock;
+ uint32_t OptimalTransferLengthGranularity;
+ } *Media;
+
+ EFI_STATUS (EFIAPI *Reset)(
+ EFI_BLOCK_IO_PROTOCOL *This,
+ bool ExtendedVerification);
+ EFI_STATUS (EFIAPI *ReadBlocks)(
+ EFI_BLOCK_IO_PROTOCOL *This,
+ uint32_t MediaId,
+ EFI_LBA LBA,
+ size_t BufferSize,
+ void *Buffer);
+ EFI_STATUS (EFIAPI *WriteBlocks)(
+ EFI_BLOCK_IO_PROTOCOL *This,
+ uint32_t MediaId,
+ EFI_LBA LBA,
+ size_t BufferSize,
+ void *Buffer);
+ EFI_STATUS (EFIAPI *FlushBlocks)(EFI_BLOCK_IO_PROTOCOL *This);
+};