Changeset c6d8589b in rtems
- Timestamp:
- 06/07/18 18:18:13 (6 years ago)
- Branches:
- 5, master
- Children:
- 12a263bb
- Parents:
- 75d9e79f
- git-author:
- rrs <rrs@…> (06/07/18 18:18:13)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (11/18/19 06:16:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/include/machine/_kernel_time.h
r75d9e79f rc6d8589b 67 67 } while (0) 68 68 #endif 69 70 /* 71 * Simple macros to convert ticks to milliseconds 72 * or microseconds and vice-versa. The answer 73 * will always be at least 1. Note the return 74 * value is a uint32_t however we step up the 75 * operations to 64 bit to avoid any overflow/underflow 76 * problems. 77 */ 78 #define TICKS_2_MSEC(t) max(1, (uint32_t)(hz == 1000) ? \ 79 (t) : (((uint64_t)(t) * (uint64_t)1000)/(uint64_t)hz)) 80 #define TICKS_2_USEC(t) max(1, (uint32_t)(hz == 1000) ? \ 81 ((t) * 1000) : (((uint64_t)(t) * (uint64_t)1000000)/(uint64_t)hz)) 82 #define MSEC_2_TICKS(m) max(1, (uint32_t)((hz == 1000) ? \ 83 (m) : ((uint64_t)(m) * (uint64_t)hz)/(uint64_t)1000)) 84 #define USEC_2_TICKS(u) max(1, (uint32_t)((hz == 1000) ? \ 85 ((u) / 1000) : ((uint64_t)(u) * (uint64_t)hz)/(uint64_t)1000000)) 69 86 70 87 /* Operations on timevals. */
Note: See TracChangeset
for help on using the changeset viewer.