summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-05-28 12:16:26 +0000
committerderaadt <deraadt@openbsd.org>1996-05-28 12:16:26 +0000
commitd4f19e3b4487907f22a8ae9dabf3c2076c3ca4a4 (patch)
treec80b234cc709753b44860b9f1e9f3d5d47254ccc /sys/vm/vm_glue.c
parentIgnore CRASH directory (diff)
downloadwireguard-openbsd-d4f19e3b4487907f22a8ae9dabf3c2076c3ca4a4.tar.xz
wireguard-openbsd-d4f19e3b4487907f22a8ae9dabf3c2076c3ca4a4.zip
thread changes
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index d3f818dcba8..83d253b6353 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_glue.c,v 1.15 1996/05/22 12:03:13 deraadt Exp $ */
+/* $OpenBSD: vm_glue.c,v 1.16 1996/05/28 12:16:32 deraadt Exp $ */
/* $NetBSD: vm_glue.c,v 1.55 1996/05/19 10:00:38 ragge Exp $ */
/*
@@ -548,6 +548,59 @@ swapout(p)
}
/*
+ * The rest of these routines fake thread handling
+ */
+
+void
+assert_wait(event, ruptible)
+ void *event;
+ boolean_t ruptible;
+{
+#ifdef lint
+ ruptible++;
+#endif
+ curproc->p_thread = event;
+}
+
+void
+thread_block()
+{
+ int s = splhigh();
+
+ if (curproc->p_thread)
+ tsleep(curproc->p_thread, PVM, "thrd_block", 0);
+ splx(s);
+}
+
+void
+thread_sleep(event, lock, ruptible)
+ void *event;
+ simple_lock_t lock;
+ boolean_t ruptible;
+{
+ int s = splhigh();
+
+#ifdef lint
+ ruptible++;
+#endif
+ curproc->p_thread = event;
+ simple_unlock(lock);
+ if (curproc->p_thread)
+ tsleep(event, PVM, "thrd_sleep", 0);
+ splx(s);
+}
+
+void
+thread_wakeup(event)
+ void *event;
+{
+ int s = splhigh();
+
+ wakeup(event);
+ splx(s);
+}
+
+/*
* DEBUG stuff
*/