Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/linux Add some hlist ...



details:   https://anonhg.NetBSD.org/src/rev/98c7e87ff49b
branches:  riastradh-drm2
changeset: 788137:98c7e87ff49b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 02:24:29 2013 +0000

description:
Add some hlist operations to <linux/list.h>.

Also add some bogus `rcu-safe' operations, to be filled in with the
right memory barriers later.

diffstat:

 sys/external/bsd/drm2/include/linux/list.h |  37 +++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)

diffs (56 lines):

diff -r fb74e49ca9fe -r 98c7e87ff49b sys/external/bsd/drm2/include/linux/list.h
--- a/sys/external/bsd/drm2/include/linux/list.h        Wed Jul 24 02:24:16 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/list.h        Wed Jul 24 02:24:29 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: list.h,v 1.1.2.7 2013/07/24 02:20:24 riastradh Exp $   */
+/*     $NetBSD: list.h,v 1.1.2.8 2013/07/24 02:24:29 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -185,6 +185,30 @@
        return LIST_NEXT(node, hln_entry);
 }
 
+static inline void
+hlist_add_head(struct hlist_node *node, struct hlist_head *head)
+{
+       LIST_INSERT_HEAD(head, node, hln_entry);
+}
+
+static inline void
+hlist_add_after(struct hlist_node *node, struct hlist_node *next)
+{
+       LIST_INSERT_AFTER(node, next, hln_entry);
+}
+
+static inline void
+hlist_del(struct hlist_node *node)
+{
+       LIST_REMOVE(node, hln_entry);
+}
+
+static inline void
+hlist_del_init(struct hlist_node *node)
+{
+       LIST_REMOVE(node, hln_entry);
+}
+
 #define        hlist_entry(PTR, TYPE, FIELD)   container_of(PTR, TYPE, FIELD)
 #define        hlist_for_each(VAR, HEAD)       LIST_FOREACH(VAR, HEAD, hln_entry)
 #define        hlist_for_each_safe(VAR, NEXT, HEAD)                            \
@@ -196,4 +220,15 @@
                    ((VAR) = hlist_entry((HLIST), typeof(*(VAR)), FIELD), 1); \
                (HLIST) = LIST_NEXT((HLIST), hln_entry))
 
+/*
+ * XXX The nominally RCU-safe APIs below lack dependent read barriers,
+ * so they're not actually RCU-safe...on the alpha, anyway.  Someone^TM
+ * should fix this.
+ */
+
+#define        hlist_add_after_rcu             hlist_add_after
+#define        hlist_add_head_rcu              hlist_add_head
+#define        hlist_del_init_rcu              hlist_del_init
+#define        hlist_for_each_entry_rcu        hlist_for_each_entry
+
 #endif  /* _LINUX_LIST_H_ */



Home | Main Index | Thread Index | Old Index