diff options
Diffstat (limited to 'libcr_ipc/include')
-rw-r--r-- | libcr_ipc/include/libcr_ipc/_linkedlist_pub.h | 26 | ||||
-rw-r--r-- | libcr_ipc/include/libcr_ipc/chan.h | 7 | ||||
-rw-r--r-- | libcr_ipc/include/libcr_ipc/mutex.h | 5 | ||||
-rw-r--r-- | libcr_ipc/include/libcr_ipc/rpc.h | 5 | ||||
-rw-r--r-- | libcr_ipc/include/libcr_ipc/rwmutex.h | 5 | ||||
-rw-r--r-- | libcr_ipc/include/libcr_ipc/sema.h | 5 |
6 files changed, 11 insertions, 42 deletions
diff --git a/libcr_ipc/include/libcr_ipc/_linkedlist_pub.h b/libcr_ipc/include/libcr_ipc/_linkedlist_pub.h deleted file mode 100644 index 6719ba4..0000000 --- a/libcr_ipc/include/libcr_ipc/_linkedlist_pub.h +++ /dev/null @@ -1,26 +0,0 @@ -/* libcr_ipc/_linkedlist_pub.h - Common low-level linked lists for use in libcr_ipc - * - * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -#ifndef _LIBCR_IPC__LINKEDLIST_PUB_H_ -#define _LIBCR_IPC__LINKEDLIST_PUB_H_ - -/* singly linked list *********************************************************/ - -struct _cr_ipc_sll_node; - -typedef struct { - struct _cr_ipc_sll_node *front, *rear; -} _cr_ipc_sll_root; - -/* doubly linked list *********************************************************/ - -struct _cr_ipc_dll_node; - -typedef struct { - struct _cr_ipc_dll_node *front, *rear; -} _cr_ipc_dll_root; - -#endif /* _LIBCR_IPC__LINKEDLIST_PUB_H_ */ diff --git a/libcr_ipc/include/libcr_ipc/chan.h b/libcr_ipc/include/libcr_ipc/chan.h index ad311a0..80acdb8 100644 --- a/libcr_ipc/include/libcr_ipc/chan.h +++ b/libcr_ipc/include/libcr_ipc/chan.h @@ -10,9 +10,8 @@ #include <stdbool.h> /* for bool */ #include <stddef.h> /* for size_t */ -#include <libmisc/macro.h> /* LM_CAT2_() */ - -#include <libcr_ipc/_linkedlist_pub.h> +#include <libmisc/linkedlist.h> /* for lm_dll_root */ +#include <libmisc/macro.h> /* for LM_CAT2_() */ /* base channels **************************************************************/ @@ -113,7 +112,7 @@ enum _cr_chan_waiter_typ { struct _cr_chan { enum _cr_chan_waiter_typ waiter_typ; - _cr_ipc_dll_root waiters; + lm_dll_root 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 ec40f5c..0f3c9c2 100644 --- a/libcr_ipc/include/libcr_ipc/mutex.h +++ b/libcr_ipc/include/libcr_ipc/mutex.h @@ -9,10 +9,9 @@ #include <stdbool.h> /* for bool */ +#include <libmisc/linkedlist.h> #include <libmisc/private.h> -#include <libcr_ipc/_linkedlist_pub.h> - /** * A cr_mutex_t is a fair mutex. * @@ -24,7 +23,7 @@ typedef struct { BEGIN_PRIVATE(LIBCR_IPC_MUTEX_H); bool locked; - _cr_ipc_sll_root waiters; + lm_sll_root 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 07ace95..f091685 100644 --- a/libcr_ipc/include/libcr_ipc/rpc.h +++ b/libcr_ipc/include/libcr_ipc/rpc.h @@ -9,10 +9,9 @@ #include <stdbool.h> /* for bool */ +#include <libmisc/linkedlist.h> /* for lm_sll_root */ #include <libmisc/macro.h> /* for LM_CAT2_() */ -#include <libcr_ipc/_linkedlist_pub.h> - /** * CR_RPC_DECLARE(NAME, REQ_T, RESP_T) declares the following types * and methods: @@ -146,7 +145,7 @@ enum _cr_rpc_waiter_typ { struct _cr_rpc { enum _cr_rpc_waiter_typ waiter_typ; - _cr_ipc_sll_root waiters; + lm_sll_root 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 924acce..d48abe9 100644 --- a/libcr_ipc/include/libcr_ipc/rwmutex.h +++ b/libcr_ipc/include/libcr_ipc/rwmutex.h @@ -9,10 +9,9 @@ #include <stdbool.h> +#include <libmisc/linkedlist.h> #include <libmisc/private.h> -#include <libcr_ipc/_linkedlist_pub.h> - /** * A cr_rwmutex_t is a fair read/write mutex. * @@ -29,7 +28,7 @@ typedef struct { unsigned nreaders; bool locked; bool unpausing; - _cr_ipc_sll_root waiters; + lm_sll_root 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 ae8d93d..cc387f4 100644 --- a/libcr_ipc/include/libcr_ipc/sema.h +++ b/libcr_ipc/include/libcr_ipc/sema.h @@ -9,10 +9,9 @@ #include <stdbool.h> +#include <libmisc/linkedlist.h> #include <libmisc/private.h> -#include <libcr_ipc/_linkedlist_pub.h> - /** * A cr_sema_t is a fair unbounded[1] counting semaphore. * @@ -22,7 +21,7 @@ typedef struct { BEGIN_PRIVATE(LIBCR_IPC_SEMA_H); unsigned int cnt; bool unpausing; - _cr_ipc_sll_root waiters; + lm_sll_root waiters; END_PRIVATE(LIBCR_IPC_SEMA_H); } cr_sema_t; |