Lines Matching +full:clock +full:- +full:bindings
1 // SPDX-License-Identifier: GPL-2.0
14 pub const NSEC_PER_MSEC: i64 = bindings::NSEC_PER_MSEC as i64;
24 pub fn msecs_to_jiffies(msecs: Msecs) -> Jiffies { in msecs_to_jiffies()
27 unsafe { bindings::__msecs_to_jiffies(msecs) } in msecs_to_jiffies()
34 inner: bindings::ktime_t,
40 pub fn from_raw(inner: bindings::ktime_t) -> Self { in from_raw()
46 pub fn ktime_get() -> Self { in ktime_get()
48 Self::from_raw(unsafe { bindings::ktime_get() }) in ktime_get()
51 /// Divide the number of nanoseconds by a compile-time constant.
53 fn divns_constant<const DIV: i64>(self) -> i64 { in divns_constant()
59 pub fn to_ns(self) -> i64 { in to_ns()
65 pub fn to_ms(self) -> i64 { in to_ms()
72 pub fn ktime_ms_delta(later: Ktime, earlier: Ktime) -> i64 { in ktime_ms_delta()
73 (later - earlier).to_ms() in ktime_ms_delta()
80 fn sub(self, other: Ktime) -> Ktime { in sub()
82 inner: self.inner - other.inner, in sub()
87 /// An identifier for a clock. Used when specifying clock sources.
90 /// Selection of the clock depends on the use case. In some cases the usage of a
91 /// particular clock is mandatory, e.g. in network protocols, filesystems.In other
92 /// cases the user of the clock has to decide which clock is best suited for the
93 /// purpose. In most scenarios clock [`ClockId::Monotonic`] is the best choice as it
98 /// A settable system-wide clock that measures real (i.e., wall-clock) time.
100 /// Setting this clock requires appropriate privileges. This clock is
102 /// administrator manually changes the clock), and by frequency adjustments
104 /// clock_adjtime(2), and ntp_adjtime(3). This clock normally counts the
105 /// number of seconds since 1970-01-01 00:00:00 Coordinated Universal Time
108 /// second smearing applies frequency adjustments to the clock to speed up
109 /// or slow down the clock to account for the leap second without
110 /// discontinuities in the clock. If leap second smearing is not applied,
111 /// the clock will experience discontinuity around leap second adjustment.
112 RealTime = bindings::CLOCK_REALTIME,
113 /// A monotonically increasing clock.
115 /// A nonsettable system-wide clock that represents monotonic time since—as
120 /// The CLOCK_MONOTONIC clock is not affected by discontinuous jumps in the
122 /// clock), but is affected by frequency adjustments. This clock does not
124 Monotonic = bindings::CLOCK_MONOTONIC,
127 /// A nonsettable system-wide clock that is identical to CLOCK_MONOTONIC,
129 /// allows applications to get a suspend-aware monotonic clock without
132 BootTime = bindings::CLOCK_BOOTTIME,
135 /// A system-wide clock derived from wall-clock time but counting leap seconds.
137 /// This clock is coupled to CLOCK_REALTIME and will be set when CLOCK_REALTIME is
141 /// smearing, this clock will not be precise during leap second smearing.
144 TAI = bindings::CLOCK_TAI,
148 fn into_c(self) -> bindings::clockid_t { in into_c()
149 self as bindings::clockid_t in into_c()