void host_notify_init(void) { int i; for (i = 0; i <= HOST_NOTIFY_TYPE_MAX; i++) queue_init(&host_notify_queue[i]); lck_grp_attr_setdefault(&host_notify_lock_grp_attr); lck_grp_init(&host_notify_lock_grp, "host_notify", &host_notify_lock_grp_attr); lck_attr_setdefault(&host_notify_lock_attr); lck_mtx_init_ext(&host_notify_lock, &host_notify_lock_ext, &host_notify_lock_grp, &host_notify_lock_attr); i = sizeof (struct host_notify_entry); host_notify_zone = zinit(i, (4096 * i), (16 * i), "host_notify"); }
void lck_mod_init( void) { /* * Obtain "lcks" options:this currently controls lock statistics */ if (!PE_parse_boot_argn("lcks", &LcksOpts, sizeof (LcksOpts))) LcksOpts = 0; #if (DEVELOPMENT || DEBUG) && defined(__x86_64__) if (!PE_parse_boot_argn("-disable_mtx_chk", &LckDisablePreemptCheck, sizeof (LckDisablePreemptCheck))) LckDisablePreemptCheck = 0; #endif /* (DEVELOPMENT || DEBUG) && defined(__x86_64__) */ queue_init(&lck_grp_queue); /* * Need to bootstrap the LockCompatGroup instead of calling lck_grp_init() here. This avoids * grabbing the lck_grp_lock before it is initialized. */ bzero(&LockCompatGroup, sizeof(lck_grp_t)); (void) strncpy(LockCompatGroup.lck_grp_name, "Compatibility APIs", LCK_GRP_MAX_NAME); if (LcksOpts & enaLkStat) LockCompatGroup.lck_grp_attr = LCK_GRP_ATTR_STAT; else LockCompatGroup.lck_grp_attr = LCK_ATTR_NONE; LockCompatGroup.lck_grp_refcnt = 1; enqueue_tail(&lck_grp_queue, (queue_entry_t)&LockCompatGroup); lck_grp_cnt = 1; lck_grp_attr_setdefault(&LockDefaultGroupAttr); lck_attr_setdefault(&LockDefaultLckAttr); lck_mtx_init_ext(&lck_grp_lock, &lck_grp_lock_ext, &LockCompatGroup, &LockDefaultLckAttr); }
/* * Initialize global state needed for run-time * port debugging. */ void ipc_port_debug_init(void) { queue_init(&port_alloc_queue); lck_mtx_init_ext(&port_alloc_queue_lock, &port_alloc_queue_lock_ext, &ipc_lck_grp, &ipc_lck_attr); }