* vm_copy_on_write_area() now does no longer overwrite the ref_count, but keeps it's reference to the cache until it has unlocked it. * It now also locks its reference from the start, preventing any other thread to interfere. * vm_cache_remove_consumer() now detects if it has to remove a foreign busy page itself in order to preserve a mapped page. * vm_soft_fault() now keeps a reference to the cache that owns the page to be mapped until it has actually mapped it. * vm_unmap_pages() removed the mappings of all pages of the area instead of only those that are within the requested range. * Kept (disabled) debug output for convenience. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21482 a95241bf-73f2-0310-859d-f6bbb57e9c96
43 lines
1.4 KiB
C
43 lines
1.4 KiB
C
/*
|
|
* Copyright 2003-2007, Axel Dörfler, [email protected].
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
* Distributed under the terms of the NewOS License.
|
|
*/
|
|
#ifndef _KERNEL_VM_CACHE_H
|
|
#define _KERNEL_VM_CACHE_H
|
|
|
|
|
|
#include <kernel.h>
|
|
#include <vm.h>
|
|
|
|
struct kernel_args;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
status_t vm_cache_init(struct kernel_args *args);
|
|
vm_cache *vm_cache_create(vm_store *store);
|
|
status_t vm_cache_ref_create(vm_cache *cache, bool acquireLock);
|
|
void vm_cache_acquire_ref(vm_cache_ref *cache_ref);
|
|
void vm_cache_release_ref(vm_cache_ref *cache_ref);
|
|
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);
|
|
void vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer);
|
|
void vm_cache_add_consumer_locked(vm_cache_ref *cacheRef, vm_cache *consumer);
|
|
status_t vm_cache_write_modified(vm_cache_ref *ref, bool fsReenter);
|
|
status_t vm_cache_set_minimal_commitment_locked(vm_cache_ref *ref, off_t commitment);
|
|
status_t vm_cache_resize(vm_cache_ref *cacheRef, off_t newSize);
|
|
status_t vm_cache_insert_area_locked(vm_cache_ref *cacheRef, vm_area *area);
|
|
status_t vm_cache_remove_area(vm_cache_ref *cacheRef, vm_area *area);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _KERNEL_VM_CACHE_H */
|