summaryrefslogtreecommitdiff
path: root/libcr_ipc/chan.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcr_ipc/chan.c')
-rw-r--r--libcr_ipc/chan.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libcr_ipc/chan.c b/libcr_ipc/chan.c
index 12d2ec2..6ccfa44 100644
--- a/libcr_ipc/chan.c
+++ b/libcr_ipc/chan.c
@@ -13,12 +13,10 @@
#include <libcr_ipc/chan.h>
-#include "_linkedlist.h"
-
/* base channels **************************************************************/
struct cr_chan_waiter {
- cr_ipc_dll_node;
+ lm_dll_node;
cid_t cid;
void *val_ptr;
void (*dequeue)(void *, size_t);
@@ -28,7 +26,7 @@ struct cr_chan_waiter {
void cr_chan_dequeue(void *_ch, size_t) {
struct _cr_chan *ch = _ch;
- cr_ipc_dll_pop_from_front(&ch->waiters);
+ lm_dll_pop_from_front(&ch->waiters);
}
void _cr_chan_xfer(enum _cr_chan_waiter_typ self_typ, struct _cr_chan *ch, void *val_ptr, size_t val_size) {
@@ -37,7 +35,7 @@ void _cr_chan_xfer(enum _cr_chan_waiter_typ self_typ, struct _cr_chan *ch, void
if (ch->waiters.front && ch->waiter_typ != self_typ) { /* non-blocking fast-path */
/* Copy. */
- struct cr_chan_waiter *front = cr_ipc_dll_node_cast(struct cr_chan_waiter, ch->waiters.front);
+ struct cr_chan_waiter *front = lm_dll_node_cast(struct cr_chan_waiter, ch->waiters.front);
if (self_typ == _CR_CHAN_SENDER)
memcpy(front->val_ptr, val_ptr, val_size);
else
@@ -53,7 +51,7 @@ void _cr_chan_xfer(enum _cr_chan_waiter_typ self_typ, struct _cr_chan *ch, void
.dequeue = cr_chan_dequeue,
.dequeue_arg1 = ch,
};
- cr_ipc_dll_push_to_rear(&ch->waiters, &self);
+ lm_dll_push_to_rear(&ch->waiters, &self);
ch->waiter_typ = self_typ;
cr_pause_and_yield();
}
@@ -95,8 +93,8 @@ static inline enum cr_select_class cr_select_getclass(struct cr_select_arg arg)
void cr_select_dequeue(void *_waiters, size_t idx) {
struct cr_select_waiters *waiters = _waiters;
for (size_t i = 0; i < waiters->cnt; i++)
- cr_ipc_dll_remove(&(waiters->args[i].ch->waiters),
- &(waiters->nodes[i]));
+ lm_dll_remove(&(waiters->args[i].ch->waiters),
+ &(waiters->nodes[i]));
waiters->cnt = idx;
}
@@ -162,7 +160,7 @@ size_t cr_select_v(size_t arg_cnt, struct cr_select_arg arg_vec[]) {
.dequeue_arg1 = &waiters,
.dequeue_arg2 = i,
};
- cr_ipc_dll_push_to_rear(&arg_vec[i].ch->waiters, &waiters.nodes[i]);
+ lm_dll_push_to_rear(&arg_vec[i].ch->waiters, &waiters.nodes[i]);
}
cr_pause_and_yield();
return waiters.cnt;