Skip to content

Commit c37fb59

Browse files
uefi-raw: Add TimestampProtocol
1 parent 7e18c2d commit c37fb59

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

uefi-raw/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# uefi-raw - [Unreleased]
22

3+
## Added
4+
- Added `TimestampProtocol`.
5+
36
# uefi-raw - 0.5.1 (2024-03-17)
47

58
## Added

uefi-raw/src/protocol/misc.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use crate::{guid, Guid, Status};
2+
3+
#[derive(Debug)]
4+
#[repr(C)]
5+
pub struct TimestampProtocol {
6+
pub get_timestamp: unsafe extern "efiapi" fn() -> u64,
7+
pub get_properties: unsafe extern "efiapi" fn(*mut TimestampProperties) -> Status,
8+
}
9+
10+
impl TimestampProtocol {
11+
pub const GUID: Guid = guid!("afbfde41-2e6e-4262-ba65-62b9236e5495");
12+
}
13+
14+
/// Properties of the timestamp counter.
15+
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
16+
#[repr(C)]
17+
pub struct TimestampProperties {
18+
/// Timestamp counter frequency, in Hz.
19+
frequency: u64,
20+
21+
/// The maximum value of the timestamp counter before it rolls over. For
22+
/// example, a 24-bit counter would have an end value of `0xff_ffff`.
23+
end_value: u64,
24+
}

uefi-raw/src/protocol/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub mod file_system;
1313
pub mod loaded_image;
1414
pub mod media;
1515
pub mod memory_protection;
16+
pub mod misc;
1617
pub mod network;
1718
pub mod rng;
1819
pub mod shell_params;

0 commit comments

Comments
 (0)