Lines Matching +full:dead +full:- +full:time
4 * SPDX-License-Identifier: Apache-2.0
19 * @defgroup timeutil_unit_apis Time Units Helpers
22 * @brief Various helper APIs for converting between time units.
26 /** @brief System-wide macro to denote "forever" in milliseconds
33 #define SYS_FOREVER_MS (-1)
35 /** @brief System-wide macro to denote "forever" in microseconds
39 #define SYS_FOREVER_US (-1)
41 /** @brief System-wide macro to convert milliseconds to kernel timeouts
46 /* Exhaustively enumerated, highly optimized time unit conversion API */
94 /* Time converter generator gadget. Selects from one of three
103 * appropriately in a user-facing API. The boolean arguments are:
105 * const_hz - The hz arguments are known to be compile-time
108 * result32 - The result will be truncated to 32 bits on use
109 * round_up - Return the ceiling of the resulting fraction
110 * round_off - Return the nearest value to the resulting fraction
135 (__round_up) ? ((__from_hz) / (__to_hz)) - 1 : \
142 * Some compiler versions emit a divide-by-zero warning for this code:
143 * "false ? 42/0 : 43". Dealing with (generated) dead code is hard:
144 * https://github.com/zephyrproject-rtos/zephyr/issues/63564
145 * https://blog.llvm.org/2011/05/what-every-c-programmer-should-know_21.html
147 * To silence such divide-by-zero warnings, "cheat" and never return
149 * little bit the huge pain of "reverse-engineering" pre-processor
153 * evaluating the same expression twice. However: 1. it's a non-standard
155 * at compile time anyway.
165 (__round_up) ? (__from_hz) - 1 : \
168 /* Integer division 32-bit conversion */
170 ((uint64_t) (__t) <= 0xffffffffU - \
183 /* Integer multiplication 32-bit conversion */
187 /* General 32-bit conversion */
192 /* Integer division 64-bit conversion */
198 /* Integer multiplication 64-bit conversion */
202 /* Fast 64-bit conversion. This relies on the multiply not overflowing */
207 /* Slow 64-bit conversion. This avoids overflowing the multiply */
213 /* General 64-bit conversion. Uses one of the two above macros */
219 /* Convert, generating a 32-bit result */
238 /* Convert, generating a 64-bit result */
272 * #!/usr/bin/perl -w
308 * print " * Converts time values in $hfrom to $hto.\n";
320 * print " * \@param t Source time in $hfrom. uint64_t\n";
322 * print " * \@return The converted time value in $hto. $type\n";
347 * Converts time values in seconds to hardware cycles.
353 * @param t Source time in seconds. uint64_t
355 * @return The converted time value in hardware cycles. uint32_t
363 * Converts time values in seconds to hardware cycles.
369 * @param t Source time in seconds. uint64_t
371 * @return The converted time value in hardware cycles. uint64_t
379 * Converts time values in seconds to hardware cycles.
385 * @param t Source time in seconds. uint64_t
387 * @return The converted time value in hardware cycles. uint32_t
395 * Converts time values in seconds to hardware cycles.
401 * @param t Source time in seconds. uint64_t
403 * @return The converted time value in hardware cycles. uint64_t
411 * Converts time values in seconds to hardware cycles.
417 * @param t Source time in seconds. uint64_t
419 * @return The converted time value in hardware cycles. uint32_t
427 * Converts time values in seconds to hardware cycles.
433 * @param t Source time in seconds. uint64_t
435 * @return The converted time value in hardware cycles. uint64_t
443 * Converts time values in seconds to ticks.
449 * @param t Source time in seconds. uint64_t
451 * @return The converted time value in ticks. uint32_t
459 * Converts time values in seconds to ticks.
465 * @param t Source time in seconds. uint64_t
467 * @return The converted time value in ticks. uint64_t
475 * Converts time values in seconds to ticks.
481 * @param t Source time in seconds. uint64_t
483 * @return The converted time value in ticks. uint32_t
491 * Converts time values in seconds to ticks.
497 * @param t Source time in seconds. uint64_t
499 * @return The converted time value in ticks. uint64_t
507 * Converts time values in seconds to ticks.
513 * @param t Source time in seconds. uint64_t
515 * @return The converted time value in ticks. uint32_t
523 * Converts time values in seconds to ticks.
529 * @param t Source time in seconds. uint64_t
531 * @return The converted time value in ticks. uint64_t
539 * Converts time values in milliseconds to hardware cycles.
545 * @param t Source time in milliseconds. uint64_t
547 * @return The converted time value in hardware cycles. uint32_t
555 * Converts time values in milliseconds to hardware cycles.
561 * @param t Source time in milliseconds. uint64_t
563 * @return The converted time value in hardware cycles. uint64_t
571 * Converts time values in milliseconds to hardware cycles.
577 * @param t Source time in milliseconds. uint64_t
579 * @return The converted time value in hardware cycles. uint32_t
587 * Converts time values in milliseconds to hardware cycles.
593 * @param t Source time in milliseconds. uint64_t
595 * @return The converted time value in hardware cycles. uint64_t
603 * Converts time values in milliseconds to hardware cycles.
609 * @param t Source time in milliseconds. uint64_t
611 * @return The converted time value in hardware cycles. uint32_t
619 * Converts time values in milliseconds to hardware cycles.
625 * @param t Source time in milliseconds. uint64_t
627 * @return The converted time value in hardware cycles. uint64_t
635 * Converts time values in milliseconds to ticks.
641 * @param t Source time in milliseconds. uint64_t
643 * @return The converted time value in ticks. uint32_t
651 * Converts time values in milliseconds to ticks.
657 * @param t Source time in milliseconds. uint64_t
659 * @return The converted time value in ticks. uint64_t
667 * Converts time values in milliseconds to ticks.
673 * @param t Source time in milliseconds. uint64_t
675 * @return The converted time value in ticks. uint32_t
683 * Converts time values in milliseconds to ticks.
689 * @param t Source time in milliseconds. uint64_t
691 * @return The converted time value in ticks. uint64_t
699 * Converts time values in milliseconds to ticks.
705 * @param t Source time in milliseconds. uint64_t
707 * @return The converted time value in ticks. uint32_t
715 * Converts time values in milliseconds to ticks.
721 * @param t Source time in milliseconds. uint64_t
723 * @return The converted time value in ticks. uint64_t
731 * Converts time values in microseconds to hardware cycles.
737 * @param t Source time in microseconds. uint64_t
739 * @return The converted time value in hardware cycles. uint32_t
747 * Converts time values in microseconds to hardware cycles.
753 * @param t Source time in microseconds. uint64_t
755 * @return The converted time value in hardware cycles. uint64_t
763 * Converts time values in microseconds to hardware cycles.
769 * @param t Source time in microseconds. uint64_t
771 * @return The converted time value in hardware cycles. uint32_t
779 * Converts time values in microseconds to hardware cycles.
785 * @param t Source time in microseconds. uint64_t
787 * @return The converted time value in hardware cycles. uint64_t
795 * Converts time values in microseconds to hardware cycles.
801 * @param t Source time in microseconds. uint64_t
803 * @return The converted time value in hardware cycles. uint32_t
811 * Converts time values in microseconds to hardware cycles.
817 * @param t Source time in microseconds. uint64_t
819 * @return The converted time value in hardware cycles. uint64_t
827 * Converts time values in microseconds to ticks.
833 * @param t Source time in microseconds. uint64_t
835 * @return The converted time value in ticks. uint32_t
843 * Converts time values in microseconds to ticks.
849 * @param t Source time in microseconds. uint64_t
851 * @return The converted time value in ticks. uint64_t
859 * Converts time values in microseconds to ticks.
865 * @param t Source time in microseconds. uint64_t
867 * @return The converted time value in ticks. uint32_t
875 * Converts time values in microseconds to ticks.
881 * @param t Source time in microseconds. uint64_t
883 * @return The converted time value in ticks. uint64_t
891 * Converts time values in microseconds to ticks.
897 * @param t Source time in microseconds. uint64_t
899 * @return The converted time value in ticks. uint32_t
907 * Converts time values in microseconds to ticks.
913 * @param t Source time in microseconds. uint64_t
915 * @return The converted time value in ticks. uint64_t
923 * Converts time values in nanoseconds to hardware cycles.
929 * @param t Source time in nanoseconds. uint64_t
931 * @return The converted time value in hardware cycles. uint32_t
939 * Converts time values in nanoseconds to hardware cycles.
945 * @param t Source time in nanoseconds. uint64_t
947 * @return The converted time value in hardware cycles. uint64_t
955 * Converts time values in nanoseconds to hardware cycles.
961 * @param t Source time in nanoseconds. uint64_t
963 * @return The converted time value in hardware cycles. uint32_t
971 * Converts time values in nanoseconds to hardware cycles.
977 * @param t Source time in nanoseconds. uint64_t
979 * @return The converted time value in hardware cycles. uint64_t
987 * Converts time values in nanoseconds to hardware cycles.
993 * @param t Source time in nanoseconds. uint64_t
995 * @return The converted time value in hardware cycles. uint32_t
1003 * Converts time values in nanoseconds to hardware cycles.
1009 * @param t Source time in nanoseconds. uint64_t
1011 * @return The converted time value in hardware cycles. uint64_t
1019 * Converts time values in nanoseconds to ticks.
1025 * @param t Source time in nanoseconds. uint64_t
1027 * @return The converted time value in ticks. uint32_t
1035 * Converts time values in nanoseconds to ticks.
1041 * @param t Source time in nanoseconds. uint64_t
1043 * @return The converted time value in ticks. uint64_t
1051 * Converts time values in nanoseconds to ticks.
1057 * @param t Source time in nanoseconds. uint64_t
1059 * @return The converted time value in ticks. uint32_t
1067 * Converts time values in nanoseconds to ticks.
1073 * @param t Source time in nanoseconds. uint64_t
1075 * @return The converted time value in ticks. uint64_t
1083 * Converts time values in nanoseconds to ticks.
1089 * @param t Source time in nanoseconds. uint64_t
1091 * @return The converted time value in ticks. uint32_t
1099 * Converts time values in nanoseconds to ticks.
1105 * @param t Source time in nanoseconds. uint64_t
1107 * @return The converted time value in ticks. uint64_t
1115 * Converts time values in hardware cycles to seconds.
1121 * @param t Source time in hardware cycles. uint64_t
1123 * @return The converted time value in seconds. uint32_t
1131 * Converts time values in hardware cycles to seconds.
1137 * @param t Source time in hardware cycles. uint64_t
1139 * @return The converted time value in seconds. uint64_t
1147 * Converts time values in hardware cycles to seconds.
1153 * @param t Source time in hardware cycles. uint64_t
1155 * @return The converted time value in seconds. uint32_t
1163 * Converts time values in hardware cycles to seconds.
1169 * @param t Source time in hardware cycles. uint64_t
1171 * @return The converted time value in seconds. uint64_t
1179 * Converts time values in hardware cycles to seconds.
1185 * @param t Source time in hardware cycles. uint64_t
1187 * @return The converted time value in seconds. uint32_t
1195 * Converts time values in hardware cycles to seconds.
1201 * @param t Source time in hardware cycles. uint64_t
1203 * @return The converted time value in seconds. uint64_t
1211 * Converts time values in hardware cycles to milliseconds.
1217 * @param t Source time in hardware cycles. uint64_t
1219 * @return The converted time value in milliseconds. uint32_t
1227 * Converts time values in hardware cycles to milliseconds.
1233 * @param t Source time in hardware cycles. uint64_t
1235 * @return The converted time value in milliseconds. uint64_t
1243 * Converts time values in hardware cycles to milliseconds.
1249 * @param t Source time in hardware cycles. uint64_t
1251 * @return The converted time value in milliseconds. uint32_t
1259 * Converts time values in hardware cycles to milliseconds.
1265 * @param t Source time in hardware cycles. uint64_t
1267 * @return The converted time value in milliseconds. uint64_t
1275 * Converts time values in hardware cycles to milliseconds.
1281 * @param t Source time in hardware cycles. uint64_t
1283 * @return The converted time value in milliseconds. uint32_t
1291 * Converts time values in hardware cycles to milliseconds.
1297 * @param t Source time in hardware cycles. uint64_t
1299 * @return The converted time value in milliseconds. uint64_t
1307 * Converts time values in hardware cycles to microseconds.
1313 * @param t Source time in hardware cycles. uint64_t
1315 * @return The converted time value in microseconds. uint32_t
1323 * Converts time values in hardware cycles to microseconds.
1329 * @param t Source time in hardware cycles. uint64_t
1331 * @return The converted time value in microseconds. uint64_t
1339 * Converts time values in hardware cycles to microseconds.
1345 * @param t Source time in hardware cycles. uint64_t
1347 * @return The converted time value in microseconds. uint32_t
1355 * Converts time values in hardware cycles to microseconds.
1361 * @param t Source time in hardware cycles. uint64_t
1363 * @return The converted time value in microseconds. uint64_t
1371 * Converts time values in hardware cycles to microseconds.
1377 * @param t Source time in hardware cycles. uint64_t
1379 * @return The converted time value in microseconds. uint32_t
1387 * Converts time values in hardware cycles to microseconds.
1393 * @param t Source time in hardware cycles. uint64_t
1395 * @return The converted time value in microseconds. uint64_t
1403 * Converts time values in hardware cycles to nanoseconds.
1409 * @param t Source time in hardware cycles. uint64_t
1411 * @return The converted time value in nanoseconds. uint32_t
1419 * Converts time values in hardware cycles to nanoseconds.
1425 * @param t Source time in hardware cycles. uint64_t
1427 * @return The converted time value in nanoseconds. uint64_t
1435 * Converts time values in hardware cycles to nanoseconds.
1441 * @param t Source time in hardware cycles. uint64_t
1443 * @return The converted time value in nanoseconds. uint32_t
1451 * Converts time values in hardware cycles to nanoseconds.
1457 * @param t Source time in hardware cycles. uint64_t
1459 * @return The converted time value in nanoseconds. uint64_t
1467 * Converts time values in hardware cycles to nanoseconds.
1473 * @param t Source time in hardware cycles. uint64_t
1475 * @return The converted time value in nanoseconds. uint32_t
1483 * Converts time values in hardware cycles to nanoseconds.
1489 * @param t Source time in hardware cycles. uint64_t
1491 * @return The converted time value in nanoseconds. uint64_t
1499 * Converts time values in hardware cycles to ticks.
1505 * @param t Source time in hardware cycles. uint64_t
1507 * @return The converted time value in ticks. uint32_t
1515 * Converts time values in hardware cycles to ticks.
1521 * @param t Source time in hardware cycles. uint64_t
1523 * @return The converted time value in ticks. uint64_t
1531 * Converts time values in hardware cycles to ticks.
1537 * @param t Source time in hardware cycles. uint64_t
1539 * @return The converted time value in ticks. uint32_t
1547 * Converts time values in hardware cycles to ticks.
1553 * @param t Source time in hardware cycles. uint64_t
1555 * @return The converted time value in ticks. uint64_t
1563 * Converts time values in hardware cycles to ticks.
1569 * @param t Source time in hardware cycles. uint64_t
1571 * @return The converted time value in ticks. uint32_t
1579 * Converts time values in hardware cycles to ticks.
1585 * @param t Source time in hardware cycles. uint64_t
1587 * @return The converted time value in ticks. uint64_t
1595 * Converts time values in ticks to seconds.
1601 * @param t Source time in ticks. uint64_t
1603 * @return The converted time value in seconds. uint32_t
1611 * Converts time values in ticks to seconds.
1617 * @param t Source time in ticks. uint64_t
1619 * @return The converted time value in seconds. uint64_t
1627 * Converts time values in ticks to seconds.
1633 * @param t Source time in ticks. uint64_t
1635 * @return The converted time value in seconds. uint32_t
1643 * Converts time values in ticks to seconds.
1649 * @param t Source time in ticks. uint64_t
1651 * @return The converted time value in seconds. uint64_t
1659 * Converts time values in ticks to seconds.
1665 * @param t Source time in ticks. uint64_t
1667 * @return The converted time value in seconds. uint32_t
1675 * Converts time values in ticks to seconds.
1681 * @param t Source time in ticks. uint64_t
1683 * @return The converted time value in seconds. uint64_t
1691 * Converts time values in ticks to milliseconds.
1697 * @param t Source time in ticks. uint64_t
1699 * @return The converted time value in milliseconds. uint32_t
1707 * Converts time values in ticks to milliseconds.
1713 * @param t Source time in ticks. uint64_t
1715 * @return The converted time value in milliseconds. uint64_t
1723 * Converts time values in ticks to milliseconds.
1729 * @param t Source time in ticks. uint64_t
1731 * @return The converted time value in milliseconds. uint32_t
1739 * Converts time values in ticks to milliseconds.
1745 * @param t Source time in ticks. uint64_t
1747 * @return The converted time value in milliseconds. uint64_t
1755 * Converts time values in ticks to milliseconds.
1761 * @param t Source time in ticks. uint64_t
1763 * @return The converted time value in milliseconds. uint32_t
1771 * Converts time values in ticks to milliseconds.
1777 * @param t Source time in ticks. uint64_t
1779 * @return The converted time value in milliseconds. uint64_t
1787 * Converts time values in ticks to microseconds.
1793 * @param t Source time in ticks. uint64_t
1795 * @return The converted time value in microseconds. uint32_t
1803 * Converts time values in ticks to microseconds.
1809 * @param t Source time in ticks. uint64_t
1811 * @return The converted time value in microseconds. uint64_t
1819 * Converts time values in ticks to microseconds.
1825 * @param t Source time in ticks. uint64_t
1827 * @return The converted time value in microseconds. uint32_t
1835 * Converts time values in ticks to microseconds.
1841 * @param t Source time in ticks. uint64_t
1843 * @return The converted time value in microseconds. uint64_t
1851 * Converts time values in ticks to microseconds.
1857 * @param t Source time in ticks. uint64_t
1859 * @return The converted time value in microseconds. uint32_t
1867 * Converts time values in ticks to microseconds.
1873 * @param t Source time in ticks. uint64_t
1875 * @return The converted time value in microseconds. uint64_t
1883 * Converts time values in ticks to nanoseconds.
1889 * @param t Source time in ticks. uint64_t
1891 * @return The converted time value in nanoseconds. uint32_t
1899 * Converts time values in ticks to nanoseconds.
1905 * @param t Source time in ticks. uint64_t
1907 * @return The converted time value in nanoseconds. uint64_t
1915 * Converts time values in ticks to nanoseconds.
1921 * @param t Source time in ticks. uint64_t
1923 * @return The converted time value in nanoseconds. uint32_t
1931 * Converts time values in ticks to nanoseconds.
1937 * @param t Source time in ticks. uint64_t
1939 * @return The converted time value in nanoseconds. uint64_t
1947 * Converts time values in ticks to nanoseconds.
1953 * @param t Source time in ticks. uint64_t
1955 * @return The converted time value in nanoseconds. uint32_t
1963 * Converts time values in ticks to nanoseconds.
1969 * @param t Source time in ticks. uint64_t
1971 * @return The converted time value in nanoseconds. uint64_t
1979 * Converts time values in ticks to hardware cycles.
1985 * @param t Source time in ticks. uint64_t
1987 * @return The converted time value in hardware cycles. uint32_t
1995 * Converts time values in ticks to hardware cycles.
2001 * @param t Source time in ticks. uint64_t
2003 * @return The converted time value in hardware cycles. uint64_t
2011 * Converts time values in ticks to hardware cycles.
2017 * @param t Source time in ticks. uint64_t
2019 * @return The converted time value in hardware cycles. uint32_t
2027 * Converts time values in ticks to hardware cycles.
2033 * @param t Source time in ticks. uint64_t
2035 * @return The converted time value in hardware cycles. uint64_t
2043 * Converts time values in ticks to hardware cycles.
2049 * @param t Source time in ticks. uint64_t
2051 * @return The converted time value in hardware cycles. uint32_t
2059 * Converts time values in ticks to hardware cycles.
2065 * @param t Source time in ticks. uint64_t
2067 * @return The converted time value in hardware cycles. uint64_t