-/* Initialise a list head to an empty list */
-#define INIT_LIST_HEAD(p) \
-do { \
- (p)->next = (p);\
- (p)->next = (p); \
-} while(0)
-
-
-/* Add an element to a list */
-static __inline__ void list_add(struct list_head *newEntry,
- struct list_head *list)
-{
- struct list_head *listNext = list->next;
-
- list->next = newEntry;
- newEntry->prev = list;
- newEntry->next = listNext;
- listNext->prev = newEntry;
-
-}
-
-
-/* Take an element out of its current list, with or without
- * reinitialising the links.of the entry*/
-static __inline__ void list_del(struct list_head *entry)
-{
- struct list_head *listNext = entry->next;
- struct list_head *listPrev = entry->prev;
-
- listNext->prev = listPrev;
- listPrev->next = listNext;
-
-}
-
-static __inline__ void list_del_init(struct list_head *entry)
-{
- list_del(entry);
- entry->next = entry->prev = entry;
-}
-
-
-/* Test if the list is empty */
-static __inline__ int list_empty(struct list_head *entry)
-{
- return (entry->next == entry);
-}
-
-
-/* list_entry takes a pointer to a list entry and offsets it to that
- * we can find a pointer to the object it is embedded in.
- */
-
-
-#define list_entry(entry, type, member) \
- ((type *)((char *)(entry)-(unsigned long)(&((type *)NULL)->member)))