From d496f014ff3f69d94e746cadd3ac16c0f802effd Mon Sep 17 00:00:00 2001 From: pooka Date: Wed, 25 Jun 2008 13:16:58 +0000 Subject: [PATCH] Don't compile kern_lock for rump any more, it's no longer required. Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump. --- sys/kern/kern_lock.c | 15 ++------------- sys/rump/librump/rumpkern/Makefile | 4 ++-- sys/rump/librump/rumpkern/emul.c | 9 ++++++++- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 79abec7eacda..5a9154ebbe98 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lock.c,v 1.144 2008/05/31 13:15:21 ad Exp $ */ +/* $NetBSD: kern_lock.c,v 1.145 2008/06/25 13:16:58 pooka Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.144 2008/05/31 13:15:21 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.145 2008/06/25 13:16:58 pooka Exp $"); #include #include @@ -59,7 +59,6 @@ __cpu_simple_lock_t kernel_lock[CACHE_LINE_SIZE / sizeof(__cpu_simple_lock_t)] void assert_sleepable(void) { -#if !defined(_RUMPKERNEL) const char *reason; if (panicstr != NULL) { @@ -83,18 +82,9 @@ assert_sleepable(void) panic("%s: %s caller=%p", __func__, reason, (void *)RETURN_ADDRESS); } -#endif /* !defined(_RUMPKERNEL) */ } #endif /* defined(DEBUG) || defined(LKM) */ -/* - * rump doesn't need the kernel lock so force it out. We cannot - * currently easily include it for compilation because of - * a) SPINLOCK_* b) membar_producer(). They are defined in different - * places / way for each arch, so just simply do not bother to - * fight a lot for no gain (i.e. pain but still no gain). - */ -#ifndef _RUMPKERNEL /* * Functions for manipulating the kernel_lock. We put them here * so that they show up in profiles. @@ -307,4 +297,3 @@ _kernel_unlock(int nlocks, int *countp) if (countp != NULL) *countp = olocks; } -#endif /* !_RUMPKERNEL */ diff --git a/sys/rump/librump/rumpkern/Makefile b/sys/rump/librump/rumpkern/Makefile index 66dedbfe1fa0..44b5829772d7 100644 --- a/sys/rump/librump/rumpkern/Makefile +++ b/sys/rump/librump/rumpkern/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2008/06/05 12:43:52 ad Exp $ +# $NetBSD: Makefile,v 1.36 2008/06/25 13:16:58 pooka Exp $ # .include @@ -19,7 +19,7 @@ SRCS= rump.c atomic.c auth.c emul.c intr.c genfs_io.c locks.c \ SRCS+= fstrans_stub.c misc_stub.c pmap_stub.c vfsops_stub.c # sys/kern -SRCS+= clock_subr.c kern_descrip.c kern_lock.c kern_stub.c param.c \ +SRCS+= clock_subr.c kern_descrip.c kern_stub.c param.c \ subr_bufq.c subr_hash.c subr_prf2.c subr_specificdata.c \ subr_time.c subr_workqueue.c sys_descrip.c sys_generic.c vfs_bio.c \ vfs_cache.c vfs_getcwd.c vfs_hooks.c vfs_init.c vfs_lookup.c \ diff --git a/sys/rump/librump/rumpkern/emul.c b/sys/rump/librump/rumpkern/emul.c index 0282c411465e..0bc380692120 100644 --- a/sys/rump/librump/rumpkern/emul.c +++ b/sys/rump/librump/rumpkern/emul.c @@ -1,4 +1,4 @@ -/* $NetBSD: emul.c,v 1.40 2008/06/24 14:11:44 pooka Exp $ */ +/* $NetBSD: emul.c,v 1.41 2008/06/25 13:16:58 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -568,3 +568,10 @@ device_xname(device_t dv) { return "bogus0"; } + +void +assert_sleepable(void) +{ + + /* always sleepable, although we should improve this */ +}