Skip to content

Commit

Permalink
protocols: add the DEVICE PATH UTILIITES protocol
Browse files Browse the repository at this point in the history
This is a required protocol.

Signed-off-by: Tom Gundersen <[email protected]>
  • Loading branch information
teg committed Feb 22, 2019
1 parent 1f06616 commit 94465e1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/protocols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
pub mod decompress;
pub mod device_path;
pub mod device_path_utilities;
pub mod file;
pub mod loaded_image;
pub mod simple_file_system;
Expand Down
42 changes: 42 additions & 0 deletions src/protocols/device_path_utilities.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//! Decompress Protocol
//!
//! The decompress protocol provides a decompression service that allows a compressed source
//! buffer in memory to be decompressed into a destination buffer in memory.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x379be4e, 0xd706, 0x437d, 0b0, 037, &[0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4]
);

#[repr(C)]
pub struct Protocol {
pub get_device_path_size: eficall!{fn(
*const crate::protocols::device_path::Protocol,
) -> usize},
pub dup_device_path: eficall!{fn(
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol},
pub append_path: eficall!{fn(
*const crate::protocols::device_path::Protocol,
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol},
pub append_node: eficall!{fn(
*const crate::protocols::device_path::Protocol,
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol},
pub append_instance: eficall!{fn(
*const crate::protocols::device_path::Protocol,
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol},
pub get_next_instance: eficall!{fn(
*mut *mut crate::protocols::device_path::Protocol,
*mut usize,
) -> *mut crate::protocols::device_path::Protocol},
pub is_multi_instance: eficall!{fn(
*const crate::protocols::device_path::Protocol,
) -> crate::base::Boolean},
pub create_node: eficall!{fn(
u8,
u8,
u16,
) -> *mut crate::protocols::device_path::Protocol},
}

0 comments on commit 94465e1

Please sign in to comment.