| 105 | } |
| 106 | |
| 107 | static __inline void |
| 108 | bintime_shift(struct bintime *_bt, int _exp) |
| 109 | { |
| 110 | |
| 111 | if (_exp > 0) { |
| 112 | _bt->sec <<= _exp; |
| 113 | _bt->sec |= _bt->frac >> (64 - _exp); |
| 114 | _bt->frac <<= _exp; |
| 115 | } else if (_exp < 0) { |
| 116 | _bt->frac >>= -_exp; |
| 117 | _bt->frac |= (uint64_t)_bt->sec << (64 + _exp); |
| 118 | _bt->sec >>= -_exp; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | #define bintime_clear(a) ((a)->sec = (a)->frac = 0) |
| 123 | #define bintime_isset(a) ((a)->sec || (a)->frac) |