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>
|
|
|
|
|
2007-09-27 16:21:33 +04:00
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
struct kernel_args;
|
|
|
|
|
2007-09-27 16:21:33 +04:00
|
|
|
//typedef struct vm_store vm_store;
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
|
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);
|
2007-09-27 16:21:33 +04:00
|
|
|
struct vm_cache *vm_cache_create(struct vm_store *store);
|
|
|
|
void vm_cache_acquire_ref(struct vm_cache *cache);
|
|
|
|
void vm_cache_release_ref(struct vm_cache *cache);
|
|
|
|
struct vm_cache *vm_cache_acquire_page_cache_ref(struct vm_page *page);
|
|
|
|
struct vm_page *vm_cache_lookup_page(struct vm_cache *cache, off_t page);
|
|
|
|
void vm_cache_insert_page(struct vm_cache *cache, struct vm_page *page,
|
|
|
|
off_t offset);
|
|
|
|
void vm_cache_remove_page(struct vm_cache *cache, struct vm_page *page);
|
|
|
|
void vm_cache_remove_consumer(struct vm_cache *cache, struct vm_cache *consumer);
|
|
|
|
void vm_cache_add_consumer_locked(struct vm_cache *cache,
|
|
|
|
struct vm_cache *consumer);
|
|
|
|
status_t vm_cache_write_modified(struct vm_cache *cache, bool fsReenter);
|
|
|
|
status_t vm_cache_set_minimal_commitment_locked(struct vm_cache *cache,
|
|
|
|
off_t commitment);
|
|
|
|
status_t vm_cache_resize(struct vm_cache *cache, off_t newSize);
|
|
|
|
status_t vm_cache_insert_area_locked(struct vm_cache *cache, vm_area *area);
|
|
|
|
status_t vm_cache_remove_area(struct vm_cache *cache, struct 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 */
|