summaryrefslogtreecommitdiff
path: root/libcr_ipc/include
diff options
context:
space:
mode:
Diffstat (limited to 'libcr_ipc/include')
-rw-r--r--libcr_ipc/include/libcr_ipc/chan.h8
-rw-r--r--libcr_ipc/include/libcr_ipc/mutex.h8
-rw-r--r--libcr_ipc/include/libcr_ipc/rpc.h6
-rw-r--r--libcr_ipc/include/libcr_ipc/rwmutex.h12
-rw-r--r--libcr_ipc/include/libcr_ipc/sema.h10
5 files changed, 27 insertions, 17 deletions
diff --git a/libcr_ipc/include/libcr_ipc/chan.h b/libcr_ipc/include/libcr_ipc/chan.h
index 5282725..5a87643 100644
--- a/libcr_ipc/include/libcr_ipc/chan.h
+++ b/libcr_ipc/include/libcr_ipc/chan.h
@@ -10,7 +10,7 @@
#include <stdbool.h> /* for bool */
#include <stddef.h> /* for size_t */
-#include <libmisc/linkedlist.h> /* for lm_dll_root */
+#include <libmisc/linkedlist.h> /* for DLIST_DECLARE() */
/* base channels **************************************************************/
@@ -106,9 +106,11 @@ enum _cr_chan_waiter_typ {
_CR_CHAN_RECVER,
};
+DLIST_DECLARE(_cr_chan_waiter_list);
+
struct _cr_chan {
- enum _cr_chan_waiter_typ waiter_typ;
- lm_dll_root waiters;
+ enum _cr_chan_waiter_typ waiter_typ;
+ struct _cr_chan_waiter_list waiters;
};
void _cr_chan_xfer(enum _cr_chan_waiter_typ self_typ, struct _cr_chan *ch, void *val_ptr, size_t val_size);
diff --git a/libcr_ipc/include/libcr_ipc/mutex.h b/libcr_ipc/include/libcr_ipc/mutex.h
index 0f3c9c2..e5f43c8 100644
--- a/libcr_ipc/include/libcr_ipc/mutex.h
+++ b/libcr_ipc/include/libcr_ipc/mutex.h
@@ -9,9 +9,11 @@
#include <stdbool.h> /* for bool */
-#include <libmisc/linkedlist.h>
+#include <libmisc/linkedlist.h> /* for SLIST_DECLARE() */
#include <libmisc/private.h>
+SLIST_DECLARE(_cr_mutex_waiter_list);
+
/**
* A cr_mutex_t is a fair mutex.
*
@@ -22,8 +24,8 @@
*/
typedef struct {
BEGIN_PRIVATE(LIBCR_IPC_MUTEX_H);
- bool locked;
- lm_sll_root waiters;
+ bool locked;
+ struct _cr_mutex_waiter_list waiters;
END_PRIVATE(LIBCR_IPC_MUTEX_H);
} cr_mutex_t;
diff --git a/libcr_ipc/include/libcr_ipc/rpc.h b/libcr_ipc/include/libcr_ipc/rpc.h
index ff75034..ecf48cf 100644
--- a/libcr_ipc/include/libcr_ipc/rpc.h
+++ b/libcr_ipc/include/libcr_ipc/rpc.h
@@ -9,7 +9,7 @@
#include <stdbool.h> /* for bool */
-#include <libmisc/linkedlist.h> /* for lm_sll_root */
+#include <libmisc/linkedlist.h> /* for SLIST_DECLARE() */
/**
* CR_RPC_DECLARE(NAME, REQ_T, RESP_T) declares the following types:
@@ -132,9 +132,11 @@ enum _cr_rpc_waiter_typ {
_CR_RPC_RESPONDER,
};
+SLIST_DECLARE(_cr_rpc_waiter_list);
+
struct _cr_rpc {
enum _cr_rpc_waiter_typ waiter_typ;
- lm_sll_root waiters;
+ struct _cr_rpc_waiter_list waiters;
};
void _cr_rpc_send_req(struct _cr_rpc *ch, void *req_ptr, size_t req_size, void *resp_ptr);
diff --git a/libcr_ipc/include/libcr_ipc/rwmutex.h b/libcr_ipc/include/libcr_ipc/rwmutex.h
index d48abe9..8ccae63 100644
--- a/libcr_ipc/include/libcr_ipc/rwmutex.h
+++ b/libcr_ipc/include/libcr_ipc/rwmutex.h
@@ -9,9 +9,11 @@
#include <stdbool.h>
-#include <libmisc/linkedlist.h>
+#include <libmisc/linkedlist.h> /* for SLIST_DECLARE() */
#include <libmisc/private.h>
+SLIST_DECLARE(_cr_rwmutex_waiter_list);
+
/**
* A cr_rwmutex_t is a fair read/write mutex.
*
@@ -25,10 +27,10 @@
*/
typedef struct {
BEGIN_PRIVATE(LIBCR_IPC_RWMUTEX_H);
- unsigned nreaders;
- bool locked;
- bool unpausing;
- lm_sll_root waiters;
+ unsigned nreaders;
+ bool locked;
+ bool unpausing;
+ struct _cr_rwmutex_waiter_list waiters;
END_PRIVATE(LIBCR_IPC_RWMUTEX_H);
} cr_rwmutex_t;
diff --git a/libcr_ipc/include/libcr_ipc/sema.h b/libcr_ipc/include/libcr_ipc/sema.h
index cc387f4..8b5ac5b 100644
--- a/libcr_ipc/include/libcr_ipc/sema.h
+++ b/libcr_ipc/include/libcr_ipc/sema.h
@@ -9,9 +9,11 @@
#include <stdbool.h>
-#include <libmisc/linkedlist.h>
+#include <libmisc/linkedlist.h> /* for SLIST_DECLARE() */
#include <libmisc/private.h>
+SLIST_DECLARE(_cr_sema_waiter_list);
+
/**
* A cr_sema_t is a fair unbounded[1] counting semaphore.
*
@@ -19,9 +21,9 @@
*/
typedef struct {
BEGIN_PRIVATE(LIBCR_IPC_SEMA_H);
- unsigned int cnt;
- bool unpausing;
- lm_sll_root waiters;
+ unsigned int cnt;
+ bool unpausing;
+ struct _cr_sema_waiter_list waiters;
END_PRIVATE(LIBCR_IPC_SEMA_H);
} cr_sema_t;