+struct domain * atalkdom = &atalkdomain;
+lck_mtx_t *atalk_mutex = NULL;
+
+lck_mtx_t *atalk_cluster_lock = NULL;
+static lck_attr_t *atalk_lock_attr;
+static lck_grp_t *atalk_lock_grp;
+static lck_grp_attr_t *atalk_lock_grp_attr;
+
+static int at_saved_lock, at_saved_unlock;
+
+SYSCTL_NODE(_net, PF_APPLETALK, appletalk, CTLFLAG_RW|CTLFLAG_LOCKED, 0, "AppleTalk Family");
+
+void
+atalk_dominit(void)
+{
+ atalk_mutex = atalkdom->dom_mtx;
+
+ atalk_lock_grp_attr = lck_grp_attr_alloc_init();
+ atalk_lock_grp = lck_grp_alloc_init("appletalk", atalk_lock_grp_attr);
+ atalk_lock_attr = lck_attr_alloc_init();
+ atalk_cluster_lock = lck_mtx_alloc_init(atalk_lock_grp,
+ atalk_lock_attr);
+}
+
+void
+atalk_lock()
+{
+ int lr_saved;
+ lr_saved = (unsigned int) __builtin_return_address(0);
+
+ lck_mtx_assert(atalkdom->dom_mtx, LCK_MTX_ASSERT_NOTOWNED);
+ lck_mtx_lock(atalkdom->dom_mtx);
+ at_saved_lock = lr_saved;
+}
+
+void
+atalk_unlock()
+{
+ int lr_saved;
+ lr_saved = (unsigned int) __builtin_return_address(0);
+
+ lck_mtx_assert(atalkdom->dom_mtx, LCK_MTX_ASSERT_OWNED);
+ at_saved_unlock = lr_saved;
+ lck_mtx_unlock(atalkdom->dom_mtx);
+
+}
+
+
+
+