2004-11-23 06:17:39 +03:00
|
|
|
/*
|
2007-01-14 21:41:57 +03:00
|
|
|
* Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de.
|
2004-11-23 06:17:39 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _KERNEL_VM_CACHE_H
|
|
|
|
#define _KERNEL_VM_CACHE_H
|
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <kernel.h>
|
|
|
|
#include <vm.h>
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
struct kernel_args;
|
|
|
|
|
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-11-08 17:16:35 +03:00
|
|
|
status_t vm_cache_init(struct kernel_args *args);
|
2002-07-09 16:24:59 +04:00
|
|
|
vm_cache *vm_cache_create(vm_store *store);
|
2006-03-06 16:06:10 +03:00
|
|
|
status_t vm_cache_ref_create(vm_cache *cache);
|
2005-12-21 20:00:03 +03:00
|
|
|
void vm_cache_acquire_ref(vm_cache_ref *cache_ref);
|
2002-07-09 16:24:59 +04:00
|
|
|
void vm_cache_release_ref(vm_cache_ref *cache_ref);
|
2004-10-08 19:07:57 +04:00
|
|
|
vm_page *vm_cache_lookup_page(vm_cache_ref *cacheRef, off_t page);
|
|
|
|
void vm_cache_insert_page(vm_cache_ref *cacheRef, vm_page *page, off_t offset);
|
|
|
|
void vm_cache_remove_page(vm_cache_ref *cacheRef, vm_page *page);
|
2006-10-10 21:16:06 +04:00
|
|
|
void vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer);
|
2007-01-14 21:41:57 +03:00
|
|
|
void vm_cache_add_consumer_locked(vm_cache_ref *cacheRef, vm_cache *consumer);
|
2006-04-12 17:34:04 +04:00
|
|
|
status_t vm_cache_write_modified(vm_cache_ref *ref, bool fsReenter);
|
2007-01-14 21:41:57 +03:00
|
|
|
status_t vm_cache_set_minimal_commitment_locked(vm_cache_ref *ref, off_t commitment);
|
2004-11-23 06:17:39 +03:00
|
|
|
status_t vm_cache_resize(vm_cache_ref *cacheRef, off_t newSize);
|
2007-01-14 21:41:57 +03:00
|
|
|
status_t vm_cache_insert_area_locked(vm_cache_ref *cacheRef, vm_area *area);
|
2004-11-08 17:16:35 +03:00
|
|
|
status_t vm_cache_remove_area(vm_cache_ref *cacheRef, vm_area *area);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2003-10-17 18:42:45 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
#endif /* _KERNEL_VM_CACHE_H */
|