summaryrefslogtreecommitdiffstats
path: root/sys/sys/event.h
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-06-26 09:32:31 +0000
committermpi <mpi@openbsd.org>2017-06-26 09:32:31 +0000
commit0623538713195a655a6f9d2c9b2e142d4e999c2f (patch)
treeaa1152fde2e63c9f9a6f8ce7b63307b81223d922 /sys/sys/event.h
parentAllow updating the destination address of an existing TDB. Since the (diff)
downloadwireguard-openbsd-0623538713195a655a6f9d2c9b2e142d4e999c2f.tar.xz
wireguard-openbsd-0623538713195a655a6f9d2c9b2e142d4e999c2f.zip
Assert that the corresponding socket is locked when manipulating socket
buffers. This is one step towards unlocking TCP input path. Note that all the functions asserting for the socket lock are not necessarilly MP-safe. All the fields of 'struct socket' aren't protected. Introduce a new kernel-only kqueue hint, NOTE_SUBMIT, to be able to tell when a filter needs to lock the underlying data structures. Logic and name taken from NetBSD. Tested by Hrvoje Popovski. ok claudio@, bluhm@, mikeb@
Diffstat (limited to 'sys/sys/event.h')
-rw-r--r--sys/sys/event.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/event.h b/sys/sys/event.h
index c359092be51..6c3de0b5a6b 100644
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.h,v 1.25 2017/05/31 14:52:05 mikeb Exp $ */
+/* $OpenBSD: event.h,v 1.26 2017/06/26 09:32:32 mpi Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -80,6 +80,13 @@ struct kevent {
#define EV_ERROR 0x4000 /* error, data contains errno */
/*
+ * hint flag for in-kernel use - must not equal any existing note
+ */
+#ifdef _KERNEL
+#define NOTE_SUBMIT 0x01000000 /* initial knote submission */
+#endif
+
+/*
* data/hint flags for EVFILT_{READ|WRITE}, shared with userspace
*/
#define NOTE_LOWAT 0x0001 /* low water mark */