summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_workq.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2007-11-25 15:56:16 +0000
committertedu <tedu@openbsd.org>2007-11-25 15:56:16 +0000
commit3802724fba94bd2272defff13235b131ff24ea02 (patch)
tree3203c7fa0deaedf81286428de152f524cb0e3d70 /sys/kern/kern_workq.c
parentdocument MBR spoofing, very minimally (diff)
downloadwireguard-openbsd-3802724fba94bd2272defff13235b131ff24ea02.tar.xz
wireguard-openbsd-3802724fba94bd2272defff13235b131ff24ea02.zip
convert crypto thread to workq. add WQ_DIRECTOK flag to workq.
combined, this lets us use crypto before the thread is running and therefore cryptoraid can attach nice and early. ok/testing deraadt mbalmer marco
Diffstat (limited to 'sys/kern/kern_workq.c')
-rw-r--r--sys/kern/kern_workq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_workq.c b/sys/kern/kern_workq.c
index 88661b91c33..cb366a3a9bf 100644
--- a/sys/kern/kern_workq.c
+++ b/sys/kern/kern_workq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_workq.c,v 1.3 2007/06/11 22:15:11 thib Exp $ */
+/* $OpenBSD: kern_workq.c,v 1.4 2007/11/25 15:56:17 tedu Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -127,8 +127,13 @@ workq_add_task(struct workq *wq, int flags, workq_fn func,
int wake = 1;
int s;
- if (wq == NULL)
+ if (wq == NULL) {
+ if (flags & WQ_DIRECTOK) {
+ func(a1, a2);
+ return 0;
+ }
wq = &workq_syswq;
+ }
s = splhigh();
wqt = pool_get(&workq_task_pool, (flags & WQ_WAITOK) ?