Module Name:    src
Committed By:   riastradh
Date:           Wed Jul 24 02:36:04 UTC 2013

Modified Files:
        src/sys/external/bsd/drm2/include/linux [riastradh-drm2]: list.h

Log Message:
Add list_move and list_replace to <linux/list.h>.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 \
    src/sys/external/bsd/drm2/include/linux/list.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/list.h
diff -u src/sys/external/bsd/drm2/include/linux/list.h:1.1.2.8 src/sys/external/bsd/drm2/include/linux/list.h:1.1.2.9
--- src/sys/external/bsd/drm2/include/linux/list.h:1.1.2.8	Wed Jul 24 02:24:29 2013
+++ src/sys/external/bsd/drm2/include/linux/list.h	Wed Jul 24 02:36:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: list.h,v 1.1.2.8 2013/07/24 02:24:29 riastradh Exp $	*/
+/*	$NetBSD: list.h,v 1.1.2.9 2013/07/24 02:36:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -131,12 +131,28 @@ list_splice_tail(const struct list_head 
 }
 
 static inline void
+list_move(struct list_head *node, struct list_head *head)
+{
+	list_del(node);
+	list_add(node, head);
+}
+
+static inline void
 list_move_tail(struct list_head *node, struct list_head *head)
 {
 	list_del(node);
 	list_add_tail(node, head);
 }
 
+static inline void
+list_replace(struct list_head *old, struct list_head *new)
+{
+	new->lh_prev = old->lh_prev;
+	old->lh_prev->lh_next = new;
+	new->lh_next = old->lh_next;
+	old->lh_next->lh_prev = new;
+}
+
 #define	list_entry(PTR, TYPE, FIELD)	container_of(PTR, TYPE, FIELD)
 #define	list_first_entry(PTR, TYPE, FIELD)				\
 	list_entry(list_first((PTR)), TYPE, FIELD)

Reply via email to