From f070e81f33c7f01a70923782b5358d014712d9ef Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 10 Dec 2014 21:52:40 +0100 Subject: 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. --- i386/i386/fpu.c | 7 ++++--- i386/i386/machine_task.c | 6 ++++-- i386/i386/pcb.c | 6 ++++-- i386/intel/pmap.c | 10 ++++++++-- 4 files changed, 20 insertions(+), 9 deletions(-) (limited to 'i386') diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c index 0f34833..476e1de 100644 --- a/i386/i386/fpu.c +++ b/i386/i386/fpu.c @@ -187,9 +187,10 @@ init_fpu(void) void fpu_module_init(void) { - kmem_cache_init(&ifps_cache, "i386_fpsave_state", - sizeof(struct i386_fpsave_state), 16, - NULL, NULL, NULL, 0); + kmem_cache_init (&ifps_cache, + "i386_fpsave_state", + sizeof(struct i386_fpsave_state), 16, + NULL, 0); } /* diff --git a/i386/i386/machine_task.c b/i386/i386/machine_task.c index 490b102..a514086 100644 --- a/i386/i386/machine_task.c +++ b/i386/i386/machine_task.c @@ -37,8 +37,10 @@ struct kmem_cache machine_task_iopb_cache; void machine_task_module_init (void) { - kmem_cache_init (&machine_task_iopb_cache, "i386_task_iopb", IOPB_BYTES, 0, - NULL, NULL, NULL, 0); + kmem_cache_init (&machine_task_iopb_cache, + "i386_task_iopb", + IOPB_BYTES, 0, + NULL, 0); } diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c index 3a0eba0..4199f78 100644 --- a/i386/i386/pcb.c +++ b/i386/i386/pcb.c @@ -370,8 +370,10 @@ thread_t switch_context( void pcb_module_init(void) { - kmem_cache_init(&pcb_cache, "pcb", sizeof(struct pcb), 0, - NULL, NULL, NULL, 0); + kmem_cache_init (&pcb_cache, + "pcb", + sizeof(struct pcb), 0, + NULL, 0); fpu_module_init(); } diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index dc9f360..102309f 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -977,9 +977,15 @@ void pmap_init(void) * and of the physical-to-virtual entries. */ s = (vm_size_t) sizeof(struct pmap); - kmem_cache_init(&pmap_cache, "pmap", s, 0, NULL, NULL, NULL, 0); + kmem_cache_init (&pmap_cache, + "pmap", + s, 0, + NULL, 0); s = (vm_size_t) sizeof(struct pv_entry); - kmem_cache_init(&pv_list_cache, "pv_entry", s, 0, NULL, NULL, NULL, 0); + kmem_cache_init (&pv_list_cache, + "pv_entry", + s, 0, + NULL, 0); #if NCPUS > 1 /* -- cgit v1.2.3