Got rid of regions - we're now back in area-land.

Renamed vm_area::lock to vm_area::protection to be less confusing - wiring
is still called wiring, though (might be renamed to lock later, as that's
how BeOS calls it).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9858 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-11-08 14:16:35 +00:00
parent 98cc327660
commit a49a5623f1
3 changed files with 31 additions and 28 deletions

View File

@ -1,5 +1,5 @@
/*
** Copyright 2002-2004, The Haiku Team. All rights reserved.
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the Haiku License.
**
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@ -50,18 +50,18 @@ status_t delete_area_etc(struct team *team, area_id area);
status_t vm_unreserve_address_range(aspace_id aid, void *address, addr_t size);
status_t vm_reserve_address_range(aspace_id aid, void **_address, uint32 addressSpec, addr_t size);
region_id vm_create_anonymous_region(aspace_id aid, const char *name, void **address, int addr_type,
addr_t size, int wiring, int lock);
region_id vm_map_physical_memory(aspace_id aid, const char *name, void **address, int addr_type,
addr_t size, int lock, addr_t phys_addr);
region_id vm_map_file(aspace_id aid, char *name, void **address, int addr_type,
addr_t size, int lock, int mapping, const char *path, off_t offset);
region_id vm_create_null_region(aspace_id aid, char *name, void **address, int addr_type, addr_t size);
area_id vm_create_anonymous_area(aspace_id aid, const char *name, void **address, uint32 addressSpec,
addr_t size, uint32 wiring, uint32 protection);
area_id vm_map_physical_memory(aspace_id aid, const char *name, void **address, uint32 addressSpec,
addr_t size, uint32 protection, addr_t phys_addr);
area_id vm_map_file(aspace_id aid, char *name, void **address, uint32 addressSpec,
addr_t size, uint32 protection, uint32 mapping, const char *path, off_t offset);
area_id vm_create_null_area(aspace_id aid, char *name, void **address, uint32 addressSpec, addr_t size);
area_id vm_copy_area(aspace_id addressSpaceID, const char *name, void **_address, uint32 addressSpec,
uint32 protection, area_id sourceID);
region_id vm_clone_region(aspace_id aid, char *name, void **address, int addr_type,
region_id source_region, int mapping, int lock);
status_t vm_delete_region(aspace_id aid, region_id id);
area_id vm_clone_area(aspace_id aid, char *name, void **address, uint32 addressSpec,
uint32 protection, uint32 mapping, area_id sourceArea);
status_t vm_delete_area(aspace_id aid, area_id id);
status_t vm_create_vnode_cache(void *vnode, void **_cache);
status_t vm_get_page_mapping(aspace_id aid, addr_t vaddr, addr_t *paddr);
@ -71,7 +71,7 @@ status_t vm_put_physical_page(addr_t vaddr);
area_id _user_create_area(const char *name, void **address, uint32 addressSpec,
size_t size, uint32 lock, uint32 protection);
status_t _user_delete_area(area_id area);
region_id _user_vm_map_file(const char *uname, void **uaddress, int addr_type,
area_id _user_vm_map_file(const char *uname, void **uaddress, int addr_type,
addr_t size, int lock, int mapping, const char *upath, off_t offset);
area_id _user_area_for(void *address);
area_id _user_find_area(const char *name);

View File

@ -1,4 +1,7 @@
/*
** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the Haiku License.
**
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
@ -16,7 +19,7 @@ struct kernel_args;
extern "C" {
#endif
status_t vm_cache_init(struct kernel_args *ka);
status_t vm_cache_init(struct kernel_args *args);
vm_cache *vm_cache_create(vm_store *store);
vm_cache_ref *vm_cache_ref_create(vm_cache *cache);
void vm_cache_acquire_ref(vm_cache_ref *cache_ref, bool acquire_store_ref);
@ -26,8 +29,8 @@ 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);
status_t vm_cache_set_minimal_commitment(vm_cache_ref *ref, off_t commitment);
status_t vm_cache_resize(vm_cache_ref *cacheRef, size_t newSize);
status_t vm_cache_insert_region(vm_cache_ref *cacheRef, vm_region *region);
status_t vm_cache_remove_region(vm_cache_ref *cacheRef, vm_region *region);
status_t vm_cache_insert_area(vm_cache_ref *cacheRef, vm_area *area);
status_t vm_cache_remove_area(vm_cache_ref *cacheRef, vm_area *area);
#ifdef __cplusplus
}

View File

@ -54,7 +54,7 @@ typedef struct vm_cache_ref {
struct vm_cache *cache;
mutex lock;
struct vm_region *region_list;
struct vm_area *areas;
int32 ref_count;
} vm_cache_ref;
@ -70,31 +70,31 @@ typedef struct vm_cache {
uint32 scan_skip : 1;
} vm_cache;
// vm region
typedef struct vm_region {
// vm area
typedef struct vm_area {
char *name;
region_id id;
area_id id;
addr_t base;
addr_t size;
int lock;
int wiring;
uint32 protection;
uint32 wiring;
int32 ref_count;
struct vm_cache_ref *cache_ref;
off_t cache_offset;
struct vm_address_space *aspace;
struct vm_region *aspace_next;
struct vm_area *aspace_next;
struct vm_virtual_map *map;
struct vm_region *cache_next;
struct vm_region *cache_prev;
struct vm_region *hash_next;
} vm_region;
struct vm_area *cache_next;
struct vm_area *cache_prev;
struct vm_area *hash_next;
} vm_area;
// virtual map (1 per address space)
typedef struct vm_virtual_map {
vm_region *region_list;
vm_region *region_hint;
vm_area *areas;
vm_area *area_hint;
int change_count;
sem_id sem;
struct vm_address_space *aspace;