Lines Matching refs:entry

37 	pool->entry = malloc_flags(pool->flags | MAF_ZERO_INIT, NULL,  in tee_mm_init()
40 if (pool->entry == NULL) in tee_mm_init()
44 pool->entry->offset = ((size - 1) >> shift) + 1; in tee_mm_init()
46 pool->entry->pool = pool; in tee_mm_init()
54 if (pool == NULL || pool->entry == NULL) in tee_mm_final()
57 while (pool->entry->next != NULL) in tee_mm_final()
58 tee_mm_free(pool->entry->next); in tee_mm_final()
59 free_flags(pool->flags, pool->entry); in tee_mm_final()
60 pool->entry = NULL; in tee_mm_final()
73 tee_mm_entry_t *entry; in tee_mm_stats_allocated() local
79 entry = pool->entry; in tee_mm_stats_allocated()
80 while (entry) { in tee_mm_stats_allocated()
81 sz += entry->size; in tee_mm_stats_allocated()
82 entry = entry->next; in tee_mm_stats_allocated()
126 tee_mm_entry_t *entry = NULL; in tee_mm_alloc_flags() local
132 if (!pool || !pool->entry) in tee_mm_alloc_flags()
144 entry = pool->entry; in tee_mm_alloc_flags()
152 while (entry->next != NULL && psize > in tee_mm_alloc_flags()
153 (entry->offset - entry->next->offset - in tee_mm_alloc_flags()
154 entry->next->size)) in tee_mm_alloc_flags()
155 entry = entry->next; in tee_mm_alloc_flags()
157 while (entry->next != NULL && psize > in tee_mm_alloc_flags()
158 (entry->next->offset - entry->size - entry->offset)) in tee_mm_alloc_flags()
159 entry = entry->next; in tee_mm_alloc_flags()
163 if (entry->next == NULL) { in tee_mm_alloc_flags()
174 if ((entry->offset << pool->shift) < size) { in tee_mm_alloc_flags()
183 remaining -= ((entry->offset + entry->size) << in tee_mm_alloc_flags()
193 tee_mm_add(entry, nn); in tee_mm_alloc_flags()
196 nn->offset = entry->offset - psize; in tee_mm_alloc_flags()
198 nn->offset = entry->offset + entry->size; in tee_mm_alloc_flags()
235 tee_mm_entry_t *entry; in tee_mm_alloc2() local
242 if (!pool || !pool->entry) in tee_mm_alloc2()
256 entry = pool->entry; in tee_mm_alloc2()
262 while (entry->next != NULL && in tee_mm_alloc2()
263 offshi < entry->next->offset + entry->next->size) in tee_mm_alloc2()
264 entry = entry->next; in tee_mm_alloc2()
266 while (entry->next != NULL && offslo > entry->next->offset) in tee_mm_alloc2()
267 entry = entry->next; in tee_mm_alloc2()
271 if (!fit_in_gap(pool, entry, offslo, offshi)) in tee_mm_alloc2()
274 tee_mm_add(entry, mm); in tee_mm_alloc2()
291 tee_mm_entry_t *entry; in tee_mm_free() local
298 entry = p->pool->entry; in tee_mm_free()
301 while (entry->next != NULL && entry->next != p) in tee_mm_free()
302 entry = entry->next; in tee_mm_free()
304 if (!entry->next) in tee_mm_free()
307 entry->next = entry->next->next; in tee_mm_free()
332 if (pool == NULL || pool->entry == NULL) in tee_mm_is_empty()
336 ret = pool->entry == NULL || pool->entry->next == NULL; in tee_mm_is_empty()
344 tee_mm_entry_t *entry = pool->entry; in tee_mm_find() local
353 while (entry->next != NULL) { in tee_mm_find()
354 entry = entry->next; in tee_mm_find()
356 if ((offset >= entry->offset) && in tee_mm_find()
357 (offset < (entry->offset + entry->size))) { in tee_mm_find()
360 return entry; in tee_mm_find()