* Converts cyclecounter cycles to nanoseconds. */
| 37 | * Converts cyclecounter cycles to nanoseconds. |
| 38 | */ |
| 39 | static inline uint64_t |
| 40 | rte_cyclecounter_cycles_to_ns(struct rte_timecounter *tc, uint64_t cycles) |
| 41 | { |
| 42 | uint64_t ns; |
| 43 | |
| 44 | /* Add fractional nanoseconds. */ |
| 45 | ns = cycles + tc->nsec_frac; |
| 46 | tc->nsec_frac = ns & tc->nsec_mask; |
| 47 | |
| 48 | /* Shift to get only nanoseconds. */ |
| 49 | return ns >> tc->cc_shift; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Update the internal nanosecond count in the structure. |
no outgoing calls
no test coverage detected