Debian Codegraph @

src/boot/proto/block-io.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "efi.h"
5
6 #define EFI_BLOCK_IO_PROTOCOL_GUID \
7 GUID_DEF(0x0964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
8
9 typedef struct EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL;
10 struct EFI_BLOCK_IO_PROTOCOL {
11 uint64_t Revision;
12 struct {
13 uint32_t MediaId;
14 bool RemovableMedia;
15 bool MediaPresent;
16 bool LogicalPartition;
17 bool ReadOnly;
18 bool WriteCaching;
19 uint32_t BlockSize;
20 uint32_t IoAlign;
21 EFI_LBA LastBlock;
22 EFI_LBA LowestAlignedLba;
23 uint32_t LogicalBlocksPerPhysicalBlock;
24 uint32_t OptimalTransferLengthGranularity;
25 } *Media;
26
27 EFI_STATUS (EFIAPI *Reset)(
28 EFI_BLOCK_IO_PROTOCOL *This,
29 bool ExtendedVerification);
30 EFI_STATUS (EFIAPI *ReadBlocks)(
31 EFI_BLOCK_IO_PROTOCOL *This,
32 uint32_t MediaId,
33 EFI_LBA LBA,
34 size_t BufferSize,
35 void *Buffer);
36 EFI_STATUS (EFIAPI *WriteBlocks)(
37 EFI_BLOCK_IO_PROTOCOL *This,
38 uint32_t MediaId,
39 EFI_LBA LBA,
40 size_t BufferSize,
41 void *Buffer);
42 EFI_STATUS (EFIAPI *FlushBlocks)(EFI_BLOCK_IO_PROTOCOL *This);
43 };