| 73 | } |
| 74 | |
| 75 | static void timer_add_raw(struct timers *timers, struct timer *t) |
| 76 | { |
| 77 | struct list_head *l; |
| 78 | unsigned int level = level_of(timers, t->time); |
| 79 | uint64_t *first; |
| 80 | |
| 81 | if (!timers->level[level]) { |
| 82 | l = &timers->far; |
| 83 | first = &timers->firsts[ARRAY_SIZE(timers->level)]; |
| 84 | } else { |
| 85 | int off = (t->time >> (level*TIMER_LEVEL_BITS)) & (PER_LEVEL-1); |
| 86 | l = &timers->level[level]->list[off]; |
| 87 | first = &timers->firsts[level]; |
| 88 | } |
| 89 | |
| 90 | list_add_tail(l, &t->list); |
| 91 | if (t->time < *first) |
| 92 | *first = t->time; |
| 93 | } |
| 94 | |
| 95 | void timer_init(struct timer *t) |
| 96 | { |
no test coverage detected