Use the pool allocator and the "nointr" pool page allocator for vm_map's.

This commit is contained in:
thorpej 1998-08-31 01:50:08 +00:00
parent be8d09cda3
commit 7338d4e403
3 changed files with 21 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.c,v 1.26 1998/08/31 01:10:15 thorpej Exp $ */
/* $NetBSD: uvm_map.c,v 1.27 1998/08/31 01:50:08 thorpej Exp $ */
/*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -116,6 +116,12 @@ struct pool uvm_vmspace_pool;
struct pool uvm_map_entry_pool;
/*
* pool for vm_map structures
*/
struct pool uvm_map_pool;
/*
* macros
*/
@ -329,6 +335,9 @@ uvm_map_init()
pool_init(&uvm_map_entry_pool, sizeof(struct vm_map_entry),
0, 0, 0, "vmmpepl", 0,
pool_page_alloc_nointr, pool_page_free_nointr, M_VMMAP);
pool_init(&uvm_map_pool, sizeof(struct vm_map),
0, 0, 0, "vmmppl", 0,
pool_page_alloc_nointr, pool_page_free_nointr, M_VMMAP);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.h,v 1.7 1998/08/13 02:11:01 eeh Exp $ */
/* $NetBSD: uvm_map.h,v 1.8 1998/08/31 01:50:10 thorpej Exp $ */
/*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -109,6 +109,11 @@
#define UVM_EXTRACT_QREF 0x4 /* use quick refs */
#define UVM_EXTRACT_FIXPROT 0x8 /* set prot to maxprot as we go */
/*
* pool for vm_map's; needed by inline functions in uvm_map_i.h
*/
extern struct pool uvm_map_pool;
/*
* handle inline options

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map_i.h,v 1.7 1998/08/13 02:11:02 eeh Exp $ */
/* $NetBSD: uvm_map_i.h,v 1.8 1998/08/31 01:50:11 thorpej Exp $ */
/*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -75,6 +75,8 @@
#include "opt_uvmhist.h"
#include <sys/pool.h>
/*
* uvm_map_i.h
*/
@ -97,7 +99,7 @@ uvm_map_create(pmap, min, max, pageable)
{
vm_map_t result;
MALLOC(result, vm_map_t, sizeof(struct vm_map), M_VMMAP, M_WAITOK);
result = pool_get(&uvm_map_pool, PR_WAITOK);
uvm_map_setup(result, min, max, pageable);
result->pmap = pmap;
return(result);
@ -239,7 +241,7 @@ uvm_map_deallocate(map)
uvm_unmap(map, map->min_offset, map->max_offset, TRUE);
pmap_destroy(map->pmap);
FREE(map, M_VMMAP);
pool_put(&uvm_map_pool, map);
}
#endif /* defined(UVM_MAP_INLINE) || defined(UVM_MAP) */