Lines Matching refs:cache
70 struct acpi_memory_list *cache; in acpi_os_create_cache() local
80 cache = acpi_os_allocate(sizeof(struct acpi_memory_list)); in acpi_os_create_cache()
81 if (!cache) { in acpi_os_create_cache()
87 memset(cache, 0, sizeof(struct acpi_memory_list)); in acpi_os_create_cache()
88 cache->list_name = cache_name; in acpi_os_create_cache()
89 cache->object_size = object_size; in acpi_os_create_cache()
90 cache->max_depth = max_depth; in acpi_os_create_cache()
92 *return_cache = cache; in acpi_os_create_cache()
108 acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) in acpi_os_purge_cache() argument
115 if (!cache) { in acpi_os_purge_cache()
126 while (cache->list_head) { in acpi_os_purge_cache()
130 next = ACPI_GET_DESCRIPTOR_PTR(cache->list_head); in acpi_os_purge_cache()
131 ACPI_FREE(cache->list_head); in acpi_os_purge_cache()
133 cache->list_head = next; in acpi_os_purge_cache()
134 cache->current_depth--; in acpi_os_purge_cache()
154 acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache) in acpi_os_delete_cache() argument
162 status = acpi_os_purge_cache(cache); in acpi_os_delete_cache()
169 acpi_os_free(cache); in acpi_os_delete_cache()
188 acpi_os_release_object(struct acpi_memory_list * cache, void *object) in acpi_os_release_object() argument
194 if (!cache || !object) { in acpi_os_release_object()
200 if (cache->current_depth >= cache->max_depth) { in acpi_os_release_object()
202 ACPI_MEM_TRACKING(cache->total_freed++); in acpi_os_release_object()
215 memset(object, 0xCA, cache->object_size); in acpi_os_release_object()
220 ACPI_SET_DESCRIPTOR_PTR(object, cache->list_head); in acpi_os_release_object()
221 cache->list_head = object; in acpi_os_release_object()
222 cache->current_depth++; in acpi_os_release_object()
243 void *acpi_os_acquire_object(struct acpi_memory_list *cache) in acpi_os_acquire_object() argument
250 if (!cache) { in acpi_os_acquire_object()
259 ACPI_MEM_TRACKING(cache->requests++); in acpi_os_acquire_object()
263 if (cache->list_head) { in acpi_os_acquire_object()
267 object = cache->list_head; in acpi_os_acquire_object()
268 cache->list_head = ACPI_GET_DESCRIPTOR_PTR(object); in acpi_os_acquire_object()
270 cache->current_depth--; in acpi_os_acquire_object()
272 ACPI_MEM_TRACKING(cache->hits++); in acpi_os_acquire_object()
275 cache->list_name)); in acpi_os_acquire_object()
284 memset(object, 0, cache->object_size); in acpi_os_acquire_object()
288 ACPI_MEM_TRACKING(cache->total_allocated++); in acpi_os_acquire_object()
291 if ((cache->total_allocated - cache->total_freed) > in acpi_os_acquire_object()
292 cache->max_occupied) { in acpi_os_acquire_object()
293 cache->max_occupied = in acpi_os_acquire_object()
294 cache->total_allocated - cache->total_freed; in acpi_os_acquire_object()
305 object = ACPI_ALLOCATE_ZEROED(cache->object_size); in acpi_os_acquire_object()