Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Change UVM_UNLOCK_AND_WAIT() to use ltsleep() (it is...
details: https://anonhg.NetBSD.org/src/rev/995ccd7d3a50
branches: trunk
changeset: 487464:995ccd7d3a50
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Jun 08 05:52:34 2000 +0000
description:
Change UVM_UNLOCK_AND_WAIT() to use ltsleep() (it is now atomic, as
advertised). Garbage-collect uvm_sleep().
diffstat:
sys/uvm/uvm.h | 13 ++++++++-----
sys/uvm/uvm_extern.h | 4 +---
sys/uvm/uvm_glue.c | 27 +--------------------------
3 files changed, 10 insertions(+), 34 deletions(-)
diffs (88 lines):
diff -r 89f9f75f0ab0 -r 995ccd7d3a50 sys/uvm/uvm.h
--- a/sys/uvm/uvm.h Thu Jun 08 05:50:59 2000 +0000
+++ b/sys/uvm/uvm.h Thu Jun 08 05:52:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm.h,v 1.21 2000/04/24 17:12:00 thorpej Exp $ */
+/* $NetBSD: uvm.h,v 1.22 2000/06/08 05:52:34 thorpej Exp $ */
/*
*
@@ -148,12 +148,15 @@
UVMHIST_DECL(pdhist);
/*
- * UVM_UNLOCK_AND_WAIT: atomic unlock+wait... front end for the
- * uvm_sleep() function.
+ * UVM_UNLOCK_AND_WAIT: atomic unlock+wait... wrapper around the
+ * interlocked tsleep() function.
*/
-#define UVM_UNLOCK_AND_WAIT(event, lock, intr, msg, timo) \
- uvm_sleep(event, lock, intr, msg, timo)
+#define UVM_UNLOCK_AND_WAIT(event, slock, intr, msg, timo) \
+do { \
+ (void) ltsleep(event, PVM | PNORELOCK | (intr ? PCATCH : 0), \
+ msg, timo, slock); \
+} while (0)
/*
* UVM_PAGE_OWN: track page ownership (only if UVM_PAGE_TRKOWN)
diff -r 89f9f75f0ab0 -r 995ccd7d3a50 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h Thu Jun 08 05:50:59 2000 +0000
+++ b/sys/uvm/uvm_extern.h Thu Jun 08 05:52:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_extern.h,v 1.41 2000/05/28 05:49:06 thorpej Exp $ */
+/* $NetBSD: uvm_extern.h,v 1.42 2000/06/08 05:52:34 thorpej Exp $ */
/*
*
@@ -296,8 +296,6 @@
#if defined(KGDB)
void uvm_chgkprot __P((caddr_t, size_t, int));
#endif
-void uvm_sleep __P((void *, struct simplelock *, boolean_t,
- const char *, int));
void uvm_fork __P((struct proc *, struct proc *, boolean_t,
void *, size_t, void (*)(void *), void *));
void uvm_exit __P((struct proc *));
diff -r 89f9f75f0ab0 -r 995ccd7d3a50 sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c Thu Jun 08 05:50:59 2000 +0000
+++ b/sys/uvm/uvm_glue.c Thu Jun 08 05:52:34 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_glue.c,v 1.34 2000/05/28 05:49:06 thorpej Exp $ */
+/* $NetBSD: uvm_glue.c,v 1.35 2000/06/08 05:52:34 thorpej Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -109,31 +109,6 @@
/*
- * uvm_sleep: atomic unlock and sleep for UVM_UNLOCK_AND_WAIT().
- */
-
-void
-uvm_sleep(event, slock, canintr, msg, timo)
- void *event;
- struct simplelock *slock;
- boolean_t canintr;
- const char *msg;
- int timo;
-{
- int s, pri;
-
- pri = PVM;
- if (canintr)
- pri |= PCATCH;
-
- s = splhigh();
- if (slock != NULL)
- simple_unlock(slock);
- (void) tsleep(event, pri, msg, timo);
- splx(s);
-}
-
-/*
* uvm_kernacc: can the kernel access a region of memory
*
* - called from malloc [DIAGNOSTIC], and /dev/kmem driver (mem.c)
Home |
Main Index |
Thread Index |
Old Index