Lines Matching refs:cache
36 struct acpi_memory_list *cache; in acpi_os_create_cache() local
46 cache = acpi_os_allocate(sizeof(struct acpi_memory_list)); in acpi_os_create_cache()
47 if (!cache) { in acpi_os_create_cache()
53 memset(cache, 0, sizeof(struct acpi_memory_list)); in acpi_os_create_cache()
54 cache->list_name = cache_name; in acpi_os_create_cache()
55 cache->object_size = object_size; in acpi_os_create_cache()
56 cache->max_depth = max_depth; in acpi_os_create_cache()
58 *return_cache = cache; in acpi_os_create_cache()
74 acpi_status acpi_os_purge_cache(struct acpi_memory_list *cache) in acpi_os_purge_cache() argument
81 if (!cache) { in acpi_os_purge_cache()
92 while (cache->list_head) { in acpi_os_purge_cache()
96 next = ACPI_GET_DESCRIPTOR_PTR(cache->list_head); in acpi_os_purge_cache()
97 ACPI_FREE(cache->list_head); in acpi_os_purge_cache()
99 cache->list_head = next; in acpi_os_purge_cache()
100 cache->current_depth--; in acpi_os_purge_cache()
120 acpi_status acpi_os_delete_cache(struct acpi_memory_list *cache) in acpi_os_delete_cache() argument
128 status = acpi_os_purge_cache(cache); in acpi_os_delete_cache()
135 acpi_os_free(cache); in acpi_os_delete_cache()
153 acpi_status acpi_os_release_object(struct acpi_memory_list *cache, void *object) in acpi_os_release_object() argument
159 if (!cache || !object) { in acpi_os_release_object()
165 if (cache->current_depth >= cache->max_depth) { in acpi_os_release_object()
167 ACPI_MEM_TRACKING(cache->total_freed++); in acpi_os_release_object()
180 memset(object, 0xCA, cache->object_size); in acpi_os_release_object()
185 ACPI_SET_DESCRIPTOR_PTR(object, cache->list_head); in acpi_os_release_object()
186 cache->list_head = object; in acpi_os_release_object()
187 cache->current_depth++; in acpi_os_release_object()
208 void *acpi_os_acquire_object(struct acpi_memory_list *cache) in acpi_os_acquire_object() argument
215 if (!cache) { in acpi_os_acquire_object()
224 ACPI_MEM_TRACKING(cache->requests++); in acpi_os_acquire_object()
228 if (cache->list_head) { in acpi_os_acquire_object()
232 object = cache->list_head; in acpi_os_acquire_object()
233 cache->list_head = ACPI_GET_DESCRIPTOR_PTR(object); in acpi_os_acquire_object()
235 cache->current_depth--; in acpi_os_acquire_object()
237 ACPI_MEM_TRACKING(cache->hits++); in acpi_os_acquire_object()
241 cache->list_name)); in acpi_os_acquire_object()
250 memset(object, 0, cache->object_size); in acpi_os_acquire_object()
254 ACPI_MEM_TRACKING(cache->total_allocated++); in acpi_os_acquire_object()
257 if ((cache->total_allocated - cache->total_freed) > in acpi_os_acquire_object()
258 cache->max_occupied) { in acpi_os_acquire_object()
259 cache->max_occupied = in acpi_os_acquire_object()
260 cache->total_allocated - cache->total_freed; in acpi_os_acquire_object()
271 object = ACPI_ALLOCATE_ZEROED(cache->object_size); in acpi_os_acquire_object()