diff options
author | Richard Braun <rbraun@sceen.net> | 2014-12-10 21:52:40 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-15 12:43:27 +0200 |
commit | f070e81f33c7f01a70923782b5358d014712d9ef (patch) | |
tree | 8ceb5b8852c111558d394b002d71fc34bc421996 /kern/slab.h | |
parent | 0b0d06c34589595cec2bea6f9b55b8e9ae51c3cf (diff) |
kern/slab: directmap update
The main impact of the direct physical mapping on the kmem module is the
slab size computation. The page allocator requires the allocation size
to be a power-of-two above the page size since it uses the buddy memory
allocation algorithm.
Custom slab allocation functions are no longer needed since the only
user was the kentry area, which has been removed recently.
The KMEM_CACHE_NOCPUPOOL flag is also no longer needed since CPU pools,
which are allocated from a kmem cache, can now always be allocated out
of the direct physical mapping.
Diffstat (limited to 'kern/slab.h')
-rw-r--r-- | kern/slab.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/kern/slab.h b/kern/slab.h index 52aa11b..6f5cc18 100644 --- a/kern/slab.h +++ b/kern/slab.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Free Software Foundation. + * Copyright (c) 2011-2015 Free Software Foundation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -69,14 +69,6 @@ struct kmem_cache; */ typedef void (*kmem_ctor_fn_t)(void *); -/* - * Types for slab allocation/free functions. - * - * All addresses and sizes must be page-aligned. - */ -typedef vm_offset_t (*kmem_slab_alloc_fn_t)(vm_size_t); -typedef void (*kmem_slab_free_fn_t)(vm_offset_t, vm_size_t); - #include <kern/slab_i.h> /* @@ -86,11 +78,6 @@ typedef struct kmem_cache *kmem_cache_t; #define KMEM_CACHE_NULL ((kmem_cache_t) 0) /* - * VM submap for slab allocations. - */ -extern vm_map_t kmem_map; - -/* * Cache initialization flags. */ #define KMEM_CACHE_NOCPUPOOL 0x1 /* Don't use the per-cpu pools */ @@ -99,14 +86,10 @@ extern vm_map_t kmem_map; /* * Initialize a cache. - * - * If a slab allocation/free function pointer is NULL, the default backend - * (vm_kmem on the kernel map) is used for the allocation/free action. */ void kmem_cache_init(struct kmem_cache *cache, const char *name, size_t obj_size, size_t align, kmem_ctor_fn_t ctor, - kmem_slab_alloc_fn_t slab_alloc_fn, - kmem_slab_free_fn_t slab_free_fn, int flags); + int flags); /* * Allocate an object from a cache. |