summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2009-11-12 19:56:49 +0000
committerShaun Ruffell <sruffell@digium.com>2009-11-12 19:56:49 +0000
commit0a371724c5489edcf30c102bf4539a518270f0a2 (patch)
tree090b2527157cb5c8e776b6f275e70acc2e4ece49 /include
parentc16dcfc5d2e181c0e2abc68454cc4382bc6fb88f (diff)
kernel.h: Define 'list_replace' for kernels < 2.6.18
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7571 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 04d8dab..731961e 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1173,6 +1173,16 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
#define kzalloc(a, b) kcalloc(1, a, b)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
+static inline void list_replace(struct list_head *old, struct list_head *new)
+{
+ new->next = old->next;
+ new->next->prev = new;
+ new->prev = old->prev;
+ new->prev->next = new;
+}
+#endif
+
#ifndef DMA_BIT_MASK
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
#endif