aboutsummaryrefslogtreecommitdiff
path: root/include/ck_queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ck_queue.h')
-rw-r--r--include/ck_queue.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/ck_queue.h b/include/ck_queue.h
index faf96a1771b2..3f503aa6c3e5 100644
--- a/include/ck_queue.h
+++ b/include/ck_queue.h
@@ -180,8 +180,14 @@ struct { \
ck_pr_store_ptr(&(head)->cslh_first, elm); \
} while (0)
+#define CK_SLIST_INSERT_PREVPTR(prevp, slistelm, elm, field) do { \
+ (elm)->field.csle_next = (slistelm); \
+ ck_pr_fence_store(); \
+ ck_pr_store_ptr(prevp, elm); \
+} while (0)
+
#define CK_SLIST_REMOVE_AFTER(elm, field) do { \
- ck_pr_store_ptr(&(elm)->field.csle_next, \
+ ck_pr_store_ptr(&(elm)->field.csle_next, \
(elm)->field.csle_next->field.csle_next); \
} while (0)
@@ -190,7 +196,7 @@ struct { \
CK_SLIST_REMOVE_HEAD((head), field); \
} else { \
struct type *curelm = (head)->cslh_first; \
- while (curelm->field.csle_next != (elm)) \
+ while (curelm->field.csle_next != (elm)) \
curelm = curelm->field.csle_next; \
CK_SLIST_REMOVE_AFTER(curelm, field); \
} \
@@ -201,6 +207,10 @@ struct { \
(head)->cslh_first->field.csle_next); \
} while (0)
+#define CK_SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \
+ ck_pr_store_ptr(prevptr, (elm)->field.csle_next); \
+} while (0)
+
#define CK_SLIST_MOVE(head1, head2, field) do { \
ck_pr_store_ptr(&(head1)->cslh_first, (head2)->cslh_first); \
} while (0)