Module Name: src Committed By: pooka Date: Wed Nov 4 18:25:36 UTC 2009
Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern emul.c vm.c Removed Files: src/sys/rump/librump/rumpkern: pool.c Log Message: Pull all relegating memory allocators under a common roof in memalloc.c To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.106 -r1.107 src/sys/rump/librump/rumpkern/emul.c cvs rdiff -u -r1.15 -r0 src/sys/rump/librump/rumpkern/pool.c cvs rdiff -u -r1.66 -r1.67 src/sys/rump/librump/rumpkern/vm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.59 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.60 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.59 Wed Nov 4 17:01:45 2009 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Nov 4 18:25:36 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.59 2009/11/04 17:01:45 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.60 2009/11/04 18:25:36 pooka Exp $ # .include "${RUMPTOP}/Makefile.rump" @@ -16,8 +16,8 @@ # Source modules, first the ones specifically implemented for librump. # SRCS= rump.c rumpcopy.c emul.c intr.c locks.c ltsleep.c \ - percpu.c pool.c scheduler.c sleepq.c sysproxy_socket.c \ - vm.c + memalloc.c percpu.c scheduler.c sleepq.c \ + sysproxy_socket.c vm.c # stubs # Index: src/sys/rump/librump/rumpkern/emul.c diff -u src/sys/rump/librump/rumpkern/emul.c:1.106 src/sys/rump/librump/rumpkern/emul.c:1.107 --- src/sys/rump/librump/rumpkern/emul.c:1.106 Wed Nov 4 17:01:45 2009 +++ src/sys/rump/librump/rumpkern/emul.c Wed Nov 4 18:25:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: emul.c,v 1.106 2009/11/04 17:01:45 pooka Exp $ */ +/* $NetBSD: emul.c,v 1.107 2009/11/04 18:25:36 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,10 +28,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.106 2009/11/04 17:01:45 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.107 2009/11/04 18:25:36 pooka Exp $"); #include <sys/param.h> -#include <sys/malloc.h> #include <sys/null.h> #include <sys/vnode.h> #include <sys/stat.h> @@ -143,46 +142,6 @@ TIMESPEC_TO_TIMEVAL(tv, &ts); } -void -malloc_type_attach(struct malloc_type *type) -{ - - return; -} - -void -malloc_type_detach(struct malloc_type *type) -{ - - return; -} - -void * -kern_malloc(unsigned long size, struct malloc_type *type, int flags) -{ - void *rv; - - rv = rumpuser_malloc(size, (flags & (M_CANFAIL | M_NOWAIT)) != 0); - if (rv && flags & M_ZERO) - memset(rv, 0, size); - - return rv; -} - -void * -kern_realloc(void *ptr, unsigned long size, struct malloc_type *type, int flags) -{ - - return rumpuser_realloc(ptr, size, (flags & (M_CANFAIL|M_NOWAIT)) != 0); -} - -void -kern_free(void *ptr, struct malloc_type *type) -{ - - rumpuser_free(ptr); -} - static void gettime(struct timespec *ts) { Index: src/sys/rump/librump/rumpkern/vm.c diff -u src/sys/rump/librump/rumpkern/vm.c:1.66 src/sys/rump/librump/rumpkern/vm.c:1.67 --- src/sys/rump/librump/rumpkern/vm.c:1.66 Wed Nov 4 16:55:20 2009 +++ src/sys/rump/librump/rumpkern/vm.c Wed Nov 4 18:25:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vm.c,v 1.66 2009/11/04 16:55:20 pooka Exp $ */ +/* $NetBSD: vm.c,v 1.67 2009/11/04 18:25:36 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -31,7 +31,6 @@ * Virtual memory emulation routines. Contents: * + anon objects & pager * + misc support routines - * + kmem */ /* @@ -42,14 +41,14 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.66 2009/11/04 16:55:20 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.67 2009/11/04 18:25:36 pooka Exp $"); #include <sys/param.h> #include <sys/atomic.h> +#include <sys/kmem.h> #include <sys/null.h> #include <sys/vnode.h> #include <sys/buf.h> -#include <sys/kmem.h> #include <machine/pmap.h> @@ -504,45 +503,6 @@ } /* - * Kmem - */ - -#ifndef RUMP_USE_REAL_ALLOCATORS -void -kmem_init() -{ - - /* nothing to do */ -} - -void * -kmem_alloc(size_t size, km_flag_t kmflag) -{ - - return rumpuser_malloc(size, kmflag == KM_NOSLEEP); -} - -void * -kmem_zalloc(size_t size, km_flag_t kmflag) -{ - void *rv; - - rv = kmem_alloc(size, kmflag); - if (rv) - memset(rv, 0, size); - - return rv; -} - -void -kmem_free(void *p, size_t size) -{ - - rumpuser_free(p); -} -#endif /* RUMP_USE_REAL_ALLOCATORS */ - -/* * UVM km */