* init pool linksets, makes proplib work. reported by Arnaud Ysmal.

(linksets, sigh)
* reduce #ifdef for RUMP_USE_REAL_ALLOCATORS
This commit is contained in:
pooka 2009-04-24 13:27:03 +00:00
parent a60f776aae
commit 2080685e3d
3 changed files with 29 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pool.c,v 1.12 2009/01/23 13:14:16 pooka Exp $ */
/* $NetBSD: pool.c,v 1.13 2009/04/24 13:27:03 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pool.c,v 1.12 2009/01/23 13:14:16 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: pool.c,v 1.13 2009/04/24 13:27:03 pooka Exp $");
#ifndef RUMP_USE_REAL_ALLOCATORS
@ -42,6 +42,20 @@ struct pool_cache pnbuf_cache;
struct pool pnbuf_pool;
struct pool_allocator pool_allocator_nointr;
void
pool_subsystem_init()
{
__link_set_decl(pools, struct link_pool_init);
struct link_pool_init *const *pi;
#define _pi(name) (*pi)->name
__link_set_foreach(pi, pools) {
pool_init(_pi(pp), _pi(size), _pi(align), _pi(align_offset),
_pi(flags), _pi(wchan), _pi(palloc), _pi(ipl));
}
#undef _pi
}
void
pool_init(struct pool *pp, size_t size, u_int align, u_int align_offset,
int flags, const char *wchan, struct pool_allocator *palloc, int ipl)

View File

@ -1,4 +1,4 @@
/* $NetBSD: rump.c,v 1.101 2009/04/16 14:07:18 pooka Exp $ */
/* $NetBSD: rump.c,v 1.102 2009/04/24 13:27:03 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.101 2009/04/16 14:07:18 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.102 2009/04/24 13:27:03 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -173,10 +173,10 @@ rump__init(int rump_version)
once_init();
rump_sleepers_init();
#ifdef RUMP_USE_REAL_ALLOCATORS
pool_subsystem_init();
kmem_init();
#endif
kprintf_init();
loginit();

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm.c,v 1.53 2009/03/18 10:22:45 cegger Exp $ */
/* $NetBSD: vm.c,v 1.54 2009/04/24 13:27:03 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.53 2009/03/18 10:22:45 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.54 2009/04/24 13:27:03 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -444,6 +444,13 @@ uvm_loanuobjpages(struct uvm_object *uobj, voff_t pgoff, int orignpages,
*/
#ifndef RUMP_USE_REAL_ALLOCATORS
void
kmem_init()
{
/* nothing to do */
}
void *
kmem_alloc(size_t size, km_flag_t kmflag)
{