summaryrefslogtreecommitdiff
path: root/kern/kmem_i.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-12-10 21:52:40 +0100
committerRichard Braun <rbraun@sceen.net>2014-12-10 23:16:47 +0100
commit7de1e22e040c51f833bfb096f2974e25f9bda2ea (patch)
treed999dade43c1d6e6fac7c7ceb6943b35193c6002 /kern/kmem_i.h
parent81a68dcbf0ecb02fa3b4e18a33788cdb5e857e34 (diff)
kern/kmem: 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/kmem_i.h')
-rw-r--r--kern/kmem_i.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/kern/kmem_i.h b/kern/kmem_i.h
index c007bfed..9a0973ba 100644
--- a/kern/kmem_i.h
+++ b/kern/kmem_i.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, 2012, 2013 Richard Braun.
+ * Copyright (c) 2010-2014 Richard Braun.
*
* 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
@@ -158,10 +158,9 @@ struct kmem_slab {
*
* The flags don't change once set and can be tested without locking.
*/
-#define KMEM_CF_NO_CPU_POOL 0x1 /* CPU pool layer disabled */
-#define KMEM_CF_SLAB_EXTERNAL 0x2 /* Slab data is off slab */
-#define KMEM_CF_VERIFY 0x4 /* Debugging facilities enabled */
-#define KMEM_CF_DIRECT 0x8 /* Quick buf-to-slab lookup */
+#define KMEM_CF_SLAB_EXTERNAL 0x1 /* Slab data is off slab */
+#define KMEM_CF_VERIFY 0x2 /* Debugging facilities enabled */
+#define KMEM_CF_DIRECT 0x4 /* Quick buf-to-slab lookup */
/*
* Cache of objects.
@@ -183,6 +182,7 @@ struct kmem_cache {
size_t align;
size_t buf_size; /* Aligned object size */
size_t bufctl_dist; /* Distance from buffer to bufctl */
+ unsigned int slab_order;
size_t slab_size;
size_t color;
size_t color_max;
@@ -192,8 +192,6 @@ struct kmem_cache {
unsigned long nr_slabs;
unsigned long nr_free_slabs;
kmem_ctor_fn_t ctor;
- kmem_slab_alloc_fn_t slab_alloc_fn;
- kmem_slab_free_fn_t slab_free_fn;
char name[KMEM_NAME_SIZE];
size_t buftag_dist; /* Distance from buffer to buftag */
size_t redzone_pad; /* Bytes from end of object to redzone word */