| 36 | } |
| 37 | |
| 38 | static struct rt_prio_queue_item* _do_pop(struct rt_prio_queue *que) |
| 39 | { |
| 40 | int ffs; |
| 41 | struct rt_prio_queue_item *item; |
| 42 | |
| 43 | ffs = __rt_ffs(que->bitmap); |
| 44 | if (ffs == 0) |
| 45 | return RT_NULL; |
| 46 | ffs--; |
| 47 | |
| 48 | item = que->head[ffs]; |
| 49 | RT_ASSERT(item); |
| 50 | |
| 51 | que->head[ffs] = item->next; |
| 52 | if (que->head[ffs] == RT_NULL) |
| 53 | { |
| 54 | que->bitmap &= ~(1 << ffs); |
| 55 | } |
| 56 | |
| 57 | return item; |
| 58 | } |
| 59 | |
| 60 | rt_err_t rt_prio_queue_init(struct rt_prio_queue *que, |
| 61 | const char *name, |
no test coverage detected