summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2016-09-15 01:05:15 +0000
committerdlg <dlg@openbsd.org>2016-09-15 01:05:15 +0000
commit8d9a1276c66c4be38bd2aa7db03d543d9f03eacb (patch)
tree85f6940b3147fb6e325d3500c6837e68764a566c
parentdont #define _KERNEL around some #includes (diff)
downloadwireguard-openbsd-8d9a1276c66c4be38bd2aa7db03d543d9f03eacb.tar.xz
wireguard-openbsd-8d9a1276c66c4be38bd2aa7db03d543d9f03eacb.zip
enable the subr_tree version of red-black trees again.
the problem with the .h file pulling in sys/param.h for NULL, which in turn goes and pulls in a ton of MI insanity, has been fixed. ok deraadt@
-rw-r--r--sys/conf/files3
-rw-r--r--sys/sys/tree.h8
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 14826d40ddd..70fd647709d 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.630 2016/09/09 04:50:54 dlg Exp $
+# $OpenBSD: files,v 1.631 2016/09/15 01:05:15 dlg Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -692,6 +692,7 @@ file kern/subr_hibernate.c hibernate
file kern/subr_log.c
file kern/subr_poison.c diagnostic
file kern/subr_pool.c
+file kern/subr_tree.c
file kern/dma_alloc.c
file kern/subr_prf.c
file kern/subr_prof.c
diff --git a/sys/sys/tree.h b/sys/sys/tree.h
index 6de132477e8..3eb354f1b21 100644
--- a/sys/sys/tree.h
+++ b/sys/sys/tree.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tree.h,v 1.21 2016/09/09 20:31:46 millert Exp $ */
+/* $OpenBSD: tree.h,v 1.22 2016/09/15 01:05:15 dlg Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -764,8 +764,6 @@ name##_RB_MINMAX(struct name *head, int val) \
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if 0
-
struct rb_type {
int (*t_compare)(const void *, const void *);
void (*t_augment)(void *);
@@ -790,6 +788,8 @@ struct _name { \
#define RBT_ENTRY(_type) struct rb_entry
+#ifdef _KERNEL
+
static inline void
_rb_init(struct rb_tree *rbt)
{
@@ -966,6 +966,6 @@ RBT_GENERATE_INTERNAL(_name, _type, _field, _cmp, _name##_RBT_AUGMENT)
(_e) != NULL && ((_n) = RBT_PREV(_name, (_e)), 1); \
(_e) = (_n))
-#endif /* 0 */
+#endif /* _KERNEL */
#endif /* _SYS_TREE_H_ */