summaryrefslogtreecommitdiffstats
path: root/sys/netatalk/ddp_pcb.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netatalk/ddp_pcb.h')
-rw-r--r--sys/netatalk/ddp_pcb.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/netatalk/ddp_pcb.h b/sys/netatalk/ddp_pcb.h
index 819d674..85ec0cc 100644
--- a/sys/netatalk/ddp_pcb.h
+++ b/sys/netatalk/ddp_pcb.h
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2004 Robert N. M. Watson
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*
@@ -17,4 +18,23 @@ int at_pcbsetaddr(struct ddpcb *ddp, struct sockaddr *addr,
struct thread *td);
void at_sockaddr(struct ddpcb *ddp, struct sockaddr **addr);
+/* Lock macros for per-pcb locks. */
+#define DDP_LOCK_INIT(ddp) mtx_init(&(ddp)->ddp_mtx, "ddp_mtx", \
+ NULL, MTX_DEF)
+#define DDP_LOCK_DESTROY(ddp) mtx_destroy(&(ddp)->ddp_mtx)
+#define DDP_LOCK(ddp) mtx_lock(&(ddp)->ddp_mtx)
+#define DDP_UNLOCK(ddp) mtx_unlock(&(ddp)->ddp_mtx)
+#define DDP_LOCK_ASSERT(ddp) mtx_assert(&(ddp)->ddp_mtx, MA_OWNED)
+
+/* Lock macros for global pcb list lock. */
+#define DDP_LIST_LOCK_INIT() mtx_init(&ddp_list_mtx, "ddp_list_mtx", \
+ NULL, MTX_DEF)
+#define DDP_LIST_LOCK_DESTROY() mtx_destroy(&ddp_list_mtx)
+#define DDP_LIST_XLOCK() mtx_lock(&ddp_list_mtx)
+#define DDP_LIST_XUNLOCK() mtx_unlock(&ddp_list_mtx)
+#define DDP_LIST_XLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED)
+#define DDP_LIST_SLOCK() mtx_lock(&ddp_list_mtx)
+#define DDP_LIST_SUNLOCK() mtx_unlock(&ddp_list_mtx)
+#define DDP_LIST_SLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED)
+
#endif
OpenPOWER on IntegriCloud