Lines Matching refs:prioarray
166 void XMC_PRIOARRAY_Init(XMC_PRIOARRAY_t *prioarray) in XMC_PRIOARRAY_Init() argument
168 XMC_ASSERT("XMC_PRIOARRAY_Init: NULL pointer", prioarray != NULL); in XMC_PRIOARRAY_Init()
171 prioarray->items[prioarray->size].next = prioarray->size + 1; in XMC_PRIOARRAY_Init()
172 prioarray->items[prioarray->size].previous = -1; in XMC_PRIOARRAY_Init()
173 prioarray->items[prioarray->size].priority = INT32_MAX; in XMC_PRIOARRAY_Init()
176 prioarray->items[prioarray->size + 1].next = -1; in XMC_PRIOARRAY_Init()
177 prioarray->items[prioarray->size + 1].previous = prioarray->size; in XMC_PRIOARRAY_Init()
178 prioarray->items[prioarray->size + 1].priority = INT32_MIN; in XMC_PRIOARRAY_Init()
182 void XMC_PRIOARRAY_Add(XMC_PRIOARRAY_t *prioarray, int32_t item, int32_t priority) in XMC_PRIOARRAY_Add() argument
187 XMC_ASSERT("XMC_PRIOARRAY_Add: item out of range", (item >= 0) && (item < prioarray->size)); in XMC_PRIOARRAY_Add()
189 next = XMC_PRIOARRAY_GetHead(prioarray); in XMC_PRIOARRAY_Add()
190 while (XMC_PRIOARRAY_GetItemPriority(prioarray, next) > priority) in XMC_PRIOARRAY_Add()
192 next = XMC_PRIOARRAY_GetItemNext(prioarray, next); in XMC_PRIOARRAY_Add()
195 previous = prioarray->items[next].previous; in XMC_PRIOARRAY_Add()
197 prioarray->items[item].next = next; in XMC_PRIOARRAY_Add()
198 prioarray->items[item].previous = previous; in XMC_PRIOARRAY_Add()
199 prioarray->items[item].priority = priority; in XMC_PRIOARRAY_Add()
201 prioarray->items[previous].next = item; in XMC_PRIOARRAY_Add()
202 prioarray->items[next].previous = item; in XMC_PRIOARRAY_Add()
205 void XMC_PRIOARRAY_Remove(XMC_PRIOARRAY_t *prioarray, int32_t item) in XMC_PRIOARRAY_Remove() argument
210 XMC_ASSERT("XMC_PRIOARRAY_Add: item out of range", (item >= 0) && (item < prioarray->size)); in XMC_PRIOARRAY_Remove()
212 next = prioarray->items[item].next; in XMC_PRIOARRAY_Remove()
213 previous = prioarray->items[item].previous; in XMC_PRIOARRAY_Remove()
215 prioarray->items[previous].next = next; in XMC_PRIOARRAY_Remove()
216 prioarray->items[next].previous = previous; in XMC_PRIOARRAY_Remove()