Skip to main content

ax_task/timers/
clock_event.rs

1//! Narrow publication capability from the logical timer owner to the runtime.
2
3/// Publishes an earlier local deadline to the physical clockevent owner.
4///
5/// Implementations may conservatively leave an already-programmed later edge
6/// pending, but must never move another CPU's comparator or execute timer
7/// payloads from this call.
8#[ax_crate_interface::def_interface]
9pub trait ClockEventControl {
10    /// Requests that the calling CPU observe `deadline_nanos`.
11    ///
12    /// The deadline is an absolute finite monotonic-clock value. This method is
13    /// called only after the logical timer-base lock has been released.
14    fn request_local_reprogram(deadline_nanos: u64);
15}
16
17pub(super) fn publish_earlier_deadline(deadline_nanos: u64) {
18    #[cfg(not(any(test, feature = "host-test")))]
19    ax_crate_interface::call_interface!(ClockEventControl::request_local_reprogram, deadline_nanos);
20    #[cfg(any(test, feature = "host-test"))]
21    let _ = deadline_nanos;
22}