git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'interrupt-rework' into prog-loader
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
ds
/
llist.h
diff --git
a/lunaix-os/includes/lunaix/ds/llist.h
b/lunaix-os/includes/lunaix/ds/llist.h
index 22e0f931b3e22fb9cad6c29963dc6f8b18b958ca..65ba474d750328d80ff3c08eba0611c9cb076f30 100644
(file)
--- a/
lunaix-os/includes/lunaix/ds/llist.h
+++ b/
lunaix-os/includes/lunaix/ds/llist.h
@@
-50,6
+50,12
@@
llist_prepend(struct llist_header* head, struct llist_header* elem)
__llist_add(elem, head, head->next);
}
__llist_add(elem, head, head->next);
}
+static inline void
+llist_insert_after(struct llist_header* head, struct llist_header* elem)
+{
+ __llist_add(elem, head, head->next);
+}
+
static inline void
llist_delete(struct llist_header* elem)
{
static inline void
llist_delete(struct llist_header* elem)
{
@@
-67,6
+73,12
@@
llist_empty(struct llist_header* elem)
return elem->next == elem && elem->prev == elem;
}
return elem->next == elem && elem->prev == elem;
}
+#define DEFINE_LLIST(name) \
+ struct llist_header name = (struct llist_header) \
+ { \
+ .prev = &name, .next = &name \
+ }
+
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.