Lines Matching refs:ate_resource
20 static void mark_ate(struct ate_resource *ate_resource, int start, int number, in mark_ate() argument
23 u64 *ate = ate_resource->ate; in mark_ate()
35 static int find_free_ate(struct ate_resource *ate_resource, int start, in find_free_ate() argument
38 u64 *ate = ate_resource->ate; in find_free_ate()
42 for (index = start; index < ate_resource->num_ate;) { in find_free_ate()
48 for (i = start_free; i < ate_resource->num_ate; i++) { in find_free_ate()
57 if (i >= ate_resource->num_ate) in find_free_ate()
69 static inline void free_ate_resource(struct ate_resource *ate_resource, in free_ate_resource() argument
72 mark_ate(ate_resource, start, ate_resource->ate[start], 0); in free_ate_resource()
73 if ((ate_resource->lowest_free_index > start) || in free_ate_resource()
74 (ate_resource->lowest_free_index < 0)) in free_ate_resource()
75 ate_resource->lowest_free_index = start; in free_ate_resource()
81 static inline int alloc_ate_resource(struct ate_resource *ate_resource, in alloc_ate_resource() argument
89 if (ate_resource->lowest_free_index < 0) in alloc_ate_resource()
96 find_free_ate(ate_resource, ate_resource->lowest_free_index, in alloc_ate_resource()
99 mark_ate(ate_resource, start_index, ate_needed, ate_needed); in alloc_ate_resource()
101 ate_resource->lowest_free_index = in alloc_ate_resource()
102 find_free_ate(ate_resource, ate_resource->lowest_free_index, 1); in alloc_ate_resource()