Lines Matching +full:pre +full:- +full:div
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
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
161 * the conversion requires a full mul/div
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