diff options
author | Richard Braun <rbraun@sceen.net> | 2012-12-18 21:41:52 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2012-12-18 21:41:52 +0100 |
commit | 448cf32233851b36e1d5f6004ee248573d2cc6ff (patch) | |
tree | d0509f47c2013984a9396b35a8df86c8fecef587 /vm/vm_map.c | |
parent | 39b79e00c60c3da0e8ad1519cac9f808d877070e (diff) |
vm/vm_map: VM map creation
Diffstat (limited to 'vm/vm_map.c')
-rw-r--r-- | vm/vm_map.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c index a29849ff..814a8760 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -118,9 +118,10 @@ static size_t vm_map_kentry_slab_size; static struct kmem_cache vm_map_kentry_cache; /* - * Cache for normal map entries. + * Caches for normal map entries and maps. */ static struct kmem_cache vm_map_entry_cache; +static struct kmem_cache vm_map_cache; static struct vm_map_kentry_slab * vm_map_kentry_alloc_slab(void) @@ -935,6 +936,24 @@ vm_map_setup(void) kmem_cache_init(&vm_map_entry_cache, "vm_map_entry", sizeof(struct vm_map_entry), 0, NULL, NULL, NULL, 0); + kmem_cache_init(&vm_map_cache, "vm_map", sizeof(struct vm_map), + 0, NULL, NULL, NULL, 0); +} + +int +vm_map_create(struct vm_map **mapp) +{ + struct vm_map *map; + + map = kmem_cache_alloc(&vm_map_cache); + + if (map == NULL) + return ERROR_NOMEM; + + /* TODO Create pmap */ + vm_map_init(map, NULL, VM_MIN_ADDRESS, VM_MAX_ADDRESS); + *mapp = map; + return 0; } void |