|
1 | 1 | // SPDX-License-Identifier: MIT OR Apache-2.0 |
2 | 2 |
|
3 | | -use crate::{Boolean, Guid, Status, guid}; |
| 3 | +use crate::{Boolean, Event, Guid, Status, guid}; |
4 | 4 | use core::ffi::c_void; |
5 | 5 |
|
6 | 6 | /// Logical block address. |
@@ -54,3 +54,39 @@ pub struct BlockIoProtocol { |
54 | 54 | impl BlockIoProtocol { |
55 | 55 | pub const GUID: Guid = guid!("964e5b21-6459-11d2-8e39-00a0c969723b"); |
56 | 56 | } |
| 57 | + |
| 58 | +#[repr(C)] |
| 59 | +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] |
| 60 | +pub struct BlockIo2Token { |
| 61 | + pub event: Event, |
| 62 | + pub transaction_status: Status, |
| 63 | +} |
| 64 | + |
| 65 | +#[derive(Debug)] |
| 66 | +#[repr(C)] |
| 67 | +pub struct BlockIo2Protocol { |
| 68 | + pub media: *const BlockIoMedia, |
| 69 | + pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: Boolean) -> Status, |
| 70 | + pub read_blocks_ex: unsafe extern "efiapi" fn( |
| 71 | + this: *const Self, |
| 72 | + media_id: u32, |
| 73 | + lba: Lba, |
| 74 | + token: *mut BlockIo2Token, |
| 75 | + buffer_size: usize, |
| 76 | + buffer: *mut c_void, |
| 77 | + ) -> Status, |
| 78 | + pub write_blocks_ex: unsafe extern "efiapi" fn( |
| 79 | + this: *mut Self, |
| 80 | + media_id: u32, |
| 81 | + lba: Lba, |
| 82 | + token: *mut BlockIo2Token, |
| 83 | + buffer_size: usize, |
| 84 | + buffer: *const c_void, |
| 85 | + ) -> Status, |
| 86 | + pub flush_blocks_ex: |
| 87 | + unsafe extern "efiapi" fn(this: *mut Self, token: *mut BlockIo2Token) -> Status, |
| 88 | +} |
| 89 | + |
| 90 | +impl BlockIo2Protocol { |
| 91 | + pub const GUID: Guid = guid!("a77b2472-e282-4e9f-a245-c2c0e27bbcc1"); |
| 92 | +} |
0 commit comments