7#ifndef ZEPHYR_INCLUDE_TIME_UNITS_H_
8#define ZEPHYR_INCLUDE_TIME_UNITS_H_
33#define SYS_FOREVER_MS (-1)
39#define SYS_FOREVER_US (-1)
43#define SYS_TIMEOUT_MS(ms) Z_TIMEOUT_TICKS((ms) == SYS_FOREVER_MS ? \
44 K_TICKS_FOREVER : Z_TIMEOUT_MS_TICKS(ms))
48#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
49__syscall
int sys_clock_hw_cycles_per_sec_runtime_get(
void);
51static inline int z_impl_sys_clock_hw_cycles_per_sec_runtime_get(
void)
53 extern int z_clock_hw_cycles_per_sec;
55 return z_clock_hw_cycles_per_sec;
59#if defined(__cplusplus) && (__cplusplus >= 201402L)
60 #if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
61 #define TIME_CONSTEXPR
63 #define TIME_CONSTEXPR constexpr
66 #define TIME_CONSTEXPR
73#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
74#define sys_clock_hw_cycles_per_sec() sys_clock_hw_cycles_per_sec_runtime_get()
76#define sys_clock_hw_cycles_per_sec() CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
90#define z_tmcvt_use_fast_algo(from_hz, to_hz) \
91 ((DIV_ROUND_UP(CONFIG_SYS_CLOCK_MAX_TIMEOUT_DAYS * 24ULL * 3600ULL * from_hz, \
92 UINT32_MAX) * to_hz) <= UINT32_MAX)
118#define z_tmcvt_is_identity(__from_hz, __to_hz) \
119 ((__to_hz) == (__from_hz))
122#define z_tmcvt_is_int_mul(__from_hz, __to_hz) \
123 ((__to_hz) > (__from_hz) && (__to_hz) % (__from_hz) == 0U)
126#define z_tmcvt_is_int_div(__from_hz, __to_hz) \
127 ((__from_hz) > (__to_hz) && (__from_hz) % (__to_hz) == 0U)
133#define z_tmcvt_off_div(__from_hz, __to_hz, __round_up, __round_off) \
134 ((__round_off) ? ((__from_hz) / (__to_hz)) / 2 : \
135 (__round_up) ? ((__from_hz) / (__to_hz)) - 1 : \
157#define z_tmcvt_divisor(a, b) ((a)/(b) ? (a)/(b) : 01u)
163#define z_tmcvt_off_gen(__from_hz, __to_hz, __round_up, __round_off) \
164 ((__round_off) ? (__from_hz) / 2 : \
165 (__round_up) ? (__from_hz) - 1 : \
169#define z_tmcvt_int_div_32(__t, __from_hz, __to_hz, __round_up, __round_off) \
170 ((uint64_t) (__t) <= 0xffffffffU - \
171 z_tmcvt_off_div(__from_hz, __to_hz, __round_up, __round_off) ? \
172 ((uint32_t)((__t) + \
173 z_tmcvt_off_div(__from_hz, __to_hz, \
174 __round_up, __round_off)) / \
175 z_tmcvt_divisor(__from_hz, __to_hz)) \
177 (uint32_t) (((uint64_t) (__t) + \
178 z_tmcvt_off_div(__from_hz, __to_hz, \
179 __round_up, __round_off)) / \
180 z_tmcvt_divisor(__from_hz, __to_hz)) \
184#define z_tmcvt_int_mul_32(__t, __from_hz, __to_hz) \
185 (uint32_t) (__t)*((__to_hz) / (__from_hz))
188#define z_tmcvt_gen_32(__t, __from_hz, __to_hz, __round_up, __round_off) \
189 ((uint32_t) (((uint64_t) (__t)*(__to_hz) + \
190 z_tmcvt_off_gen(__from_hz, __to_hz, __round_up, __round_off)) / (__from_hz)))
193#define z_tmcvt_int_div_64(__t, __from_hz, __to_hz, __round_up, __round_off) \
194 (((uint64_t) (__t) + z_tmcvt_off_div(__from_hz, __to_hz, \
195 __round_up, __round_off)) / \
196 z_tmcvt_divisor(__from_hz, __to_hz))
199#define z_tmcvt_int_mul_64(__t, __from_hz, __to_hz) \
200 (uint64_t) (__t)*((__to_hz) / (__from_hz))
203#define z_tmcvt_gen_64_fast(__t, __from_hz, __to_hz, __round_up, __round_off) \
204 (((uint64_t) (__t)*(__to_hz) + \
205 z_tmcvt_off_gen(__from_hz, __to_hz, __round_up, __round_off)) / (__from_hz))
208#define z_tmcvt_gen_64_slow(__t, __from_hz, __to_hz, __round_up, __round_off) \
209 (((uint64_t) (__t) / (__from_hz))*(__to_hz) + \
210 (((uint64_t) (__t) % (__from_hz))*(__to_hz) + \
211 z_tmcvt_off_gen(__from_hz, __to_hz, __round_up, __round_off)) / (__from_hz))
214#define z_tmcvt_gen_64(__t, __from_hz, __to_hz, __round_up, __round_off) \
215 (z_tmcvt_use_fast_algo(__from_hz, __to_hz) ? \
216 z_tmcvt_gen_64_fast(__t, __from_hz, __to_hz, __round_up, __round_off) : \
217 z_tmcvt_gen_64_slow(__t, __from_hz, __to_hz, __round_up, __round_off))
220#define z_tmcvt_32(__t, __from_hz, __to_hz, __const_hz, __round_up, __round_off) \
223 z_tmcvt_is_identity(__from_hz, __to_hz) ? \
226 z_tmcvt_is_int_div(__from_hz, __to_hz) ? \
227 z_tmcvt_int_div_32(__t, __from_hz, __to_hz, __round_up, __round_off) \
229 z_tmcvt_is_int_mul(__from_hz, __to_hz) ? \
230 z_tmcvt_int_mul_32(__t, __from_hz, __to_hz) \
232 z_tmcvt_gen_32(__t, __from_hz, __to_hz, __round_up, __round_off) \
235 z_tmcvt_gen_32(__t, __from_hz, __to_hz, __round_up, __round_off) \
239#define z_tmcvt_64(__t, __from_hz, __to_hz, __const_hz, __round_up, __round_off) \
242 z_tmcvt_is_identity(__from_hz, __to_hz) ? \
245 z_tmcvt_is_int_div(__from_hz, __to_hz) ? \
246 z_tmcvt_int_div_64(__t, __from_hz, __to_hz, __round_up, __round_off) \
248 z_tmcvt_is_int_mul(__from_hz, __to_hz) ? \
249 z_tmcvt_int_mul_64(__t, __from_hz, __to_hz) \
251 z_tmcvt_gen_64(__t, __from_hz, __to_hz, __round_up, __round_off) \
254 z_tmcvt_gen_64_slow(__t, __from_hz, __to_hz, __round_up, __round_off) \
257#define z_tmcvt(__t, __from_hz, __to_hz, __const_hz, __result32, __round_up, __round_off) \
259 z_tmcvt_32(__t, __from_hz, __to_hz, __const_hz, __round_up, __round_off) : \
260 z_tmcvt_64(__t, __from_hz, __to_hz, __const_hz, __round_up, __round_off))
339#define Z_HZ_us 1000000
340#define Z_HZ_ns 1000000000
341#define Z_HZ_cyc sys_clock_hw_cycles_per_sec()
342#define Z_HZ_ticks CONFIG_SYS_CLOCK_TICKS_PER_SEC
343#define Z_CCYC (!IS_ENABLED(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME))
357#define k_sec_to_cyc_floor32(t) \
358 z_tmcvt_32(t, Z_HZ_sec, Z_HZ_cyc, Z_CCYC, false, false)
373#define k_sec_to_cyc_floor64(t) \
374 z_tmcvt_64(t, Z_HZ_sec, Z_HZ_cyc, Z_CCYC, false, false)
389#define k_sec_to_cyc_near32(t) \
390 z_tmcvt_32(t, Z_HZ_sec, Z_HZ_cyc, Z_CCYC, false, true)
405#define k_sec_to_cyc_near64(t) \
406 z_tmcvt_64(t, Z_HZ_sec, Z_HZ_cyc, Z_CCYC, false, true)
421#define k_sec_to_cyc_ceil32(t) \
422 z_tmcvt_32(t, Z_HZ_sec, Z_HZ_cyc, Z_CCYC, true, false)
437#define k_sec_to_cyc_ceil64(t) \
438 z_tmcvt_64(t, Z_HZ_sec, Z_HZ_cyc, Z_CCYC, true, false)
453#define k_sec_to_ticks_floor32(t) \
454 z_tmcvt_32(t, Z_HZ_sec, Z_HZ_ticks, true, false, false)
469#define k_sec_to_ticks_floor64(t) \
470 z_tmcvt_64(t, Z_HZ_sec, Z_HZ_ticks, true, false, false)
485#define k_sec_to_ticks_near32(t) \
486 z_tmcvt_32(t, Z_HZ_sec, Z_HZ_ticks, true, false, true)
501#define k_sec_to_ticks_near64(t) \
502 z_tmcvt_64(t, Z_HZ_sec, Z_HZ_ticks, true, false, true)
517#define k_sec_to_ticks_ceil32(t) \
518 z_tmcvt_32(t, Z_HZ_sec, Z_HZ_ticks, true, true, false)
533#define k_sec_to_ticks_ceil64(t) \
534 z_tmcvt_64(t, Z_HZ_sec, Z_HZ_ticks, true, true, false)
549#define k_ms_to_cyc_floor32(t) \
550 z_tmcvt_32(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, false)
565#define k_ms_to_cyc_floor64(t) \
566 z_tmcvt_64(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, false)
581#define k_ms_to_cyc_near32(t) \
582 z_tmcvt_32(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, true)
597#define k_ms_to_cyc_near64(t) \
598 z_tmcvt_64(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, false, true)
613#define k_ms_to_cyc_ceil32(t) \
614 z_tmcvt_32(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, true, false)
629#define k_ms_to_cyc_ceil64(t) \
630 z_tmcvt_64(t, Z_HZ_ms, Z_HZ_cyc, Z_CCYC, true, false)
645#define k_ms_to_ticks_floor32(t) \
646 z_tmcvt_32(t, Z_HZ_ms, Z_HZ_ticks, true, false, false)
661#define k_ms_to_ticks_floor64(t) \
662 z_tmcvt_64(t, Z_HZ_ms, Z_HZ_ticks, true, false, false)
677#define k_ms_to_ticks_near32(t) \
678 z_tmcvt_32(t, Z_HZ_ms, Z_HZ_ticks, true, false, true)
693#define k_ms_to_ticks_near64(t) \
694 z_tmcvt_64(t, Z_HZ_ms, Z_HZ_ticks, true, false, true)
709#define k_ms_to_ticks_ceil32(t) \
710 z_tmcvt_32(t, Z_HZ_ms, Z_HZ_ticks, true, true, false)
725#define k_ms_to_ticks_ceil64(t) \
726 z_tmcvt_64(t, Z_HZ_ms, Z_HZ_ticks, true, true, false)
741#define k_us_to_cyc_floor32(t) \
742 z_tmcvt_32(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, false)
757#define k_us_to_cyc_floor64(t) \
758 z_tmcvt_64(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, false)
773#define k_us_to_cyc_near32(t) \
774 z_tmcvt_32(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, true)
789#define k_us_to_cyc_near64(t) \
790 z_tmcvt_64(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, false, true)
805#define k_us_to_cyc_ceil32(t) \
806 z_tmcvt_32(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, true, false)
821#define k_us_to_cyc_ceil64(t) \
822 z_tmcvt_64(t, Z_HZ_us, Z_HZ_cyc, Z_CCYC, true, false)
837#define k_us_to_ticks_floor32(t) \
838 z_tmcvt_32(t, Z_HZ_us, Z_HZ_ticks, true, false, false)
853#define k_us_to_ticks_floor64(t) \
854 z_tmcvt_64(t, Z_HZ_us, Z_HZ_ticks, true, false, false)
869#define k_us_to_ticks_near32(t) \
870 z_tmcvt_32(t, Z_HZ_us, Z_HZ_ticks, true, false, true)
885#define k_us_to_ticks_near64(t) \
886 z_tmcvt_64(t, Z_HZ_us, Z_HZ_ticks, true, false, true)
901#define k_us_to_ticks_ceil32(t) \
902 z_tmcvt_32(t, Z_HZ_us, Z_HZ_ticks, true, true, false)
917#define k_us_to_ticks_ceil64(t) \
918 z_tmcvt_64(t, Z_HZ_us, Z_HZ_ticks, true, true, false)
933#define k_ns_to_cyc_floor32(t) \
934 z_tmcvt_32(t, Z_HZ_ns, Z_HZ_cyc, Z_CCYC, false, false)
949#define k_ns_to_cyc_floor64(t) \
950 z_tmcvt_64(t, Z_HZ_ns, Z_HZ_cyc, Z_CCYC, false, false)
965#define k_ns_to_cyc_near32(t) \
966 z_tmcvt_32(t, Z_HZ_ns, Z_HZ_cyc, Z_CCYC, false, true)
981#define k_ns_to_cyc_near64(t) \
982 z_tmcvt_64(t, Z_HZ_ns, Z_HZ_cyc, Z_CCYC, false, true)
997#define k_ns_to_cyc_ceil32(t) \
998 z_tmcvt_32(t, Z_HZ_ns, Z_HZ_cyc, Z_CCYC, true, false)
1013#define k_ns_to_cyc_ceil64(t) \
1014 z_tmcvt_64(t, Z_HZ_ns, Z_HZ_cyc, Z_CCYC, true, false)
1029#define k_ns_to_ticks_floor32(t) \
1030 z_tmcvt_32(t, Z_HZ_ns, Z_HZ_ticks, true, false, false)
1045#define k_ns_to_ticks_floor64(t) \
1046 z_tmcvt_64(t, Z_HZ_ns, Z_HZ_ticks, true, false, false)
1061#define k_ns_to_ticks_near32(t) \
1062 z_tmcvt_32(t, Z_HZ_ns, Z_HZ_ticks, true, false, true)
1077#define k_ns_to_ticks_near64(t) \
1078 z_tmcvt_64(t, Z_HZ_ns, Z_HZ_ticks, true, false, true)
1093#define k_ns_to_ticks_ceil32(t) \
1094 z_tmcvt_32(t, Z_HZ_ns, Z_HZ_ticks, true, true, false)
1109#define k_ns_to_ticks_ceil64(t) \
1110 z_tmcvt_64(t, Z_HZ_ns, Z_HZ_ticks, true, true, false)
1125#define k_cyc_to_sec_floor32(t) \
1126 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_sec, Z_CCYC, false, false)
1141#define k_cyc_to_sec_floor64(t) \
1142 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_sec, Z_CCYC, false, false)
1157#define k_cyc_to_sec_near32(t) \
1158 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_sec, Z_CCYC, false, true)
1173#define k_cyc_to_sec_near64(t) \
1174 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_sec, Z_CCYC, false, true)
1189#define k_cyc_to_sec_ceil32(t) \
1190 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_sec, Z_CCYC, true, false)
1205#define k_cyc_to_sec_ceil64(t) \
1206 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_sec, Z_CCYC, true, false)
1221#define k_cyc_to_ms_floor32(t) \
1222 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, false)
1237#define k_cyc_to_ms_floor64(t) \
1238 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, false)
1253#define k_cyc_to_ms_near32(t) \
1254 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, true)
1269#define k_cyc_to_ms_near64(t) \
1270 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, false, true)
1285#define k_cyc_to_ms_ceil32(t) \
1286 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, true, false)
1301#define k_cyc_to_ms_ceil64(t) \
1302 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ms, Z_CCYC, true, false)
1317#define k_cyc_to_us_floor32(t) \
1318 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, false)
1333#define k_cyc_to_us_floor64(t) \
1334 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, false)
1349#define k_cyc_to_us_near32(t) \
1350 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, true)
1365#define k_cyc_to_us_near64(t) \
1366 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, false, true)
1381#define k_cyc_to_us_ceil32(t) \
1382 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, true, false)
1397#define k_cyc_to_us_ceil64(t) \
1398 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_us, Z_CCYC, true, false)
1413#define k_cyc_to_ns_floor32(t) \
1414 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ns, Z_CCYC, false, false)
1429#define k_cyc_to_ns_floor64(t) \
1430 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ns, Z_CCYC, false, false)
1445#define k_cyc_to_ns_near32(t) \
1446 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ns, Z_CCYC, false, true)
1461#define k_cyc_to_ns_near64(t) \
1462 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ns, Z_CCYC, false, true)
1477#define k_cyc_to_ns_ceil32(t) \
1478 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ns, Z_CCYC, true, false)
1493#define k_cyc_to_ns_ceil64(t) \
1494 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ns, Z_CCYC, true, false)
1509#define k_cyc_to_ticks_floor32(t) \
1510 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, false)
1525#define k_cyc_to_ticks_floor64(t) \
1526 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, false)
1541#define k_cyc_to_ticks_near32(t) \
1542 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, true)
1557#define k_cyc_to_ticks_near64(t) \
1558 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, false, true)
1573#define k_cyc_to_ticks_ceil32(t) \
1574 z_tmcvt_32(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, true, false)
1589#define k_cyc_to_ticks_ceil64(t) \
1590 z_tmcvt_64(t, Z_HZ_cyc, Z_HZ_ticks, Z_CCYC, true, false)
1605#define k_ticks_to_sec_floor32(t) \
1606 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_sec, true, false, false)
1621#define k_ticks_to_sec_floor64(t) \
1622 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_sec, true, false, false)
1637#define k_ticks_to_sec_near32(t) \
1638 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_sec, true, false, true)
1653#define k_ticks_to_sec_near64(t) \
1654 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_sec, true, false, true)
1669#define k_ticks_to_sec_ceil32(t) \
1670 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_sec, true, true, false)
1685#define k_ticks_to_sec_ceil64(t) \
1686 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_sec, true, true, false)
1701#define k_ticks_to_ms_floor32(t) \
1702 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_ms, true, false, false)
1717#define k_ticks_to_ms_floor64(t) \
1718 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_ms, true, false, false)
1733#define k_ticks_to_ms_near32(t) \
1734 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_ms, true, false, true)
1749#define k_ticks_to_ms_near64(t) \
1750 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_ms, true, false, true)
1765#define k_ticks_to_ms_ceil32(t) \
1766 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_ms, true, true, false)
1781#define k_ticks_to_ms_ceil64(t) \
1782 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_ms, true, true, false)
1797#define k_ticks_to_us_floor32(t) \
1798 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_us, true, false, false)
1813#define k_ticks_to_us_floor64(t) \
1814 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_us, true, false, false)
1829#define k_ticks_to_us_near32(t) \
1830 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_us, true, false, true)
1845#define k_ticks_to_us_near64(t) \
1846 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_us, true, false, true)
1861#define k_ticks_to_us_ceil32(t) \
1862 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_us, true, true, false)
1877#define k_ticks_to_us_ceil64(t) \
1878 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_us, true, true, false)
1893#define k_ticks_to_ns_floor32(t) \
1894 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_ns, true, false, false)
1909#define k_ticks_to_ns_floor64(t) \
1910 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_ns, true, false, false)
1925#define k_ticks_to_ns_near32(t) \
1926 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_ns, true, false, true)
1941#define k_ticks_to_ns_near64(t) \
1942 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_ns, true, false, true)
1957#define k_ticks_to_ns_ceil32(t) \
1958 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_ns, true, true, false)
1973#define k_ticks_to_ns_ceil64(t) \
1974 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_ns, true, true, false)
1989#define k_ticks_to_cyc_floor32(t) \
1990 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, false)
2005#define k_ticks_to_cyc_floor64(t) \
2006 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, false)
2021#define k_ticks_to_cyc_near32(t) \
2022 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, true)
2037#define k_ticks_to_cyc_near64(t) \
2038 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, false, true)
2053#define k_ticks_to_cyc_ceil32(t) \
2054 z_tmcvt_32(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, true, false)
2069#define k_ticks_to_cyc_ceil64(t) \
2070 z_tmcvt_64(t, Z_HZ_ticks, Z_HZ_cyc, Z_CCYC, true, false)
2072#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
2073#include <syscalls/time_units.h>
2076#undef TIME_CONSTEXPR