summaryrefslogtreecommitdiffstats
path: root/vendor/r-efi/src/protocols/timestamp.rs
blob: 3e8f6b5756a55203cd7b1c0ea6af494679fd18b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! EFI Timestamp Protocol
//!
//! The Timestamp protocol provides a platform independent interface for
//! retrieving a high resolution timestamp counter.

pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
    0xafbfde41,
    0x2e6e,
    0x4262,
    0xba,
    0x65,
    &[0x62, 0xb9, 0x23, 0x6e, 0x54, 0x95],
);

#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Properties {
    pub frequency: u64,
    pub end_value: u64,
}

pub type ProtocolGetTimestamp = eficall! {fn() -> u64};

pub type ProtocolGetProperties = eficall! {fn(
    *mut Properties,
) -> crate::base::Status};

#[repr(C)]
pub struct Protocol {
    pub get_timestamp: ProtocolGetTimestamp,
    pub get_properties: ProtocolGetProperties,
}