Lines Matching +full:in +full:-
4 * SPDX-License-Identifier: Apache-2.0
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
71 * @return system timer frequency in Hz
81 * maximum timeout represented in source frequency domain and multiplied by
82 * target frequency fits in 64 bits.
96 * frequencies are an integer ratio (in either direction), or a full
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:
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
154 * GNU extension; 2. everything in this file is designed to be computed
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 */
267 * precision. These units conversions were not available in 32 bit
269 * has precision traps that we probably don't want to support in an
272 * #!/usr/bin/perl -w
308 * print " * Converts time values in $hfrom to $hto.\n";
309 * print " * Computes result in $sz bit precision.\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.
348 * Computes result in 32 bit precision.
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.
364 * Computes result in 64 bit precision.
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.
380 * Computes result in 32 bit precision.
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.
396 * Computes result in 64 bit precision.
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.
412 * Computes result in 32 bit precision.
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.
428 * Computes result in 64 bit precision.
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.
444 * Computes result in 32 bit precision.
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.
460 * Computes result in 64 bit precision.
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.
476 * Computes result in 32 bit precision.
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.
492 * Computes result in 64 bit precision.
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.
508 * Computes result in 32 bit precision.
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.
524 * Computes result in 64 bit precision.
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.
540 * Computes result in 32 bit precision.
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.
556 * Computes result in 64 bit precision.
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.
572 * Computes result in 32 bit precision.
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.
588 * Computes result in 64 bit precision.
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.
604 * Computes result in 32 bit precision.
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.
620 * Computes result in 64 bit precision.
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.
636 * Computes result in 32 bit precision.
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.
652 * Computes result in 64 bit precision.
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.
668 * Computes result in 32 bit precision.
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.
684 * Computes result in 64 bit precision.
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.
700 * Computes result in 32 bit precision.
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.
716 * Computes result in 64 bit precision.
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.
732 * Computes result in 32 bit precision.
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.
748 * Computes result in 64 bit precision.
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.
764 * Computes result in 32 bit precision.
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.
780 * Computes result in 64 bit precision.
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.
796 * Computes result in 32 bit precision.
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.
812 * Computes result in 64 bit precision.
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.
828 * Computes result in 32 bit precision.
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.
844 * Computes result in 64 bit precision.
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.
860 * Computes result in 32 bit precision.
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.
876 * Computes result in 64 bit precision.
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.
892 * Computes result in 32 bit precision.
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.
908 * Computes result in 64 bit precision.
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.
924 * Computes result in 32 bit precision.
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.
940 * Computes result in 64 bit precision.
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.
956 * Computes result in 32 bit precision.
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.
972 * Computes result in 64 bit precision.
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.
988 * Computes result in 32 bit precision.
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.
1004 * Computes result in 64 bit precision.
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.
1020 * Computes result in 32 bit precision.
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.
1036 * Computes result in 64 bit precision.
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.
1052 * Computes result in 32 bit precision.
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.
1068 * Computes result in 64 bit precision.
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.
1084 * Computes result in 32 bit precision.
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.
1100 * Computes result in 64 bit precision.
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.
1116 * Computes result in 32 bit precision.
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.
1132 * Computes result in 64 bit precision.
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.
1148 * Computes result in 32 bit precision.
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.
1164 * Computes result in 64 bit precision.
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.
1180 * Computes result in 32 bit precision.
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.
1196 * Computes result in 64 bit precision.
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.
1212 * Computes result in 32 bit precision.
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.
1228 * Computes result in 64 bit precision.
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.
1244 * Computes result in 32 bit precision.
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.
1260 * Computes result in 64 bit precision.
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.
1276 * Computes result in 32 bit precision.
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.
1292 * Computes result in 64 bit precision.
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.
1308 * Computes result in 32 bit precision.
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.
1324 * Computes result in 64 bit precision.
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.
1340 * Computes result in 32 bit precision.
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.
1356 * Computes result in 64 bit precision.
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.
1372 * Computes result in 32 bit precision.
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.
1388 * Computes result in 64 bit precision.
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.
1404 * Computes result in 32 bit precision.
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.
1420 * Computes result in 64 bit precision.
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.
1436 * Computes result in 32 bit precision.
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.
1452 * Computes result in 64 bit precision.
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.
1468 * Computes result in 32 bit precision.
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.
1484 * Computes result in 64 bit precision.
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.
1500 * Computes result in 32 bit precision.
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.
1516 * Computes result in 64 bit precision.
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.
1532 * Computes result in 32 bit precision.
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.
1548 * Computes result in 64 bit precision.
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.
1564 * Computes result in 32 bit precision.
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.
1580 * Computes result in 64 bit precision.
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.
1596 * Computes result in 32 bit precision.
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.
1612 * Computes result in 64 bit precision.
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.
1628 * Computes result in 32 bit precision.
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.
1644 * Computes result in 64 bit precision.
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.
1660 * Computes result in 32 bit precision.
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.
1676 * Computes result in 64 bit precision.
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.
1692 * Computes result in 32 bit precision.
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.
1708 * Computes result in 64 bit precision.
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.
1724 * Computes result in 32 bit precision.
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.
1740 * Computes result in 64 bit precision.
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.
1756 * Computes result in 32 bit precision.
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.
1772 * Computes result in 64 bit precision.
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.
1788 * Computes result in 32 bit precision.
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.
1804 * Computes result in 64 bit precision.
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.
1820 * Computes result in 32 bit precision.
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.
1836 * Computes result in 64 bit precision.
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.
1852 * Computes result in 32 bit precision.
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.
1868 * Computes result in 64 bit precision.
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.
1884 * Computes result in 32 bit precision.
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.
1900 * Computes result in 64 bit precision.
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.
1916 * Computes result in 32 bit precision.
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.
1932 * Computes result in 64 bit precision.
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.
1948 * Computes result in 32 bit precision.
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.
1964 * Computes result in 64 bit precision.
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.
1980 * Computes result in 32 bit precision.
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.
1996 * Computes result in 64 bit precision.
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.
2012 * Computes result in 32 bit precision.
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.
2028 * Computes result in 64 bit precision.
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.
2044 * Computes result in 32 bit precision.
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.
2060 * Computes result in 64 bit precision.
2065 * @param t Source time in ticks. uint64_t
2067 * @return The converted time value in hardware cycles. uint64_t