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 list_move a...
details: https://anonhg.NetBSD.org/src/rev/252b46689510
branches: riastradh-drm2
changeset: 788182:252b46689510
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 02:36:04 2013 +0000
description:
Add list_move and list_replace to <linux/list.h>.
diffstat:
sys/external/bsd/drm2/include/linux/list.h | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diffs (38 lines):
diff -r c8ee4d80b70a -r 252b46689510 sys/external/bsd/drm2/include/linux/list.h
--- a/sys/external/bsd/drm2/include/linux/list.h Wed Jul 24 02:35:49 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/list.h Wed Jul 24 02:36:04 2013 +0000
@@ -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 @@
}
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)
Home |
Main Index |
Thread Index |
Old Index