int _fini(void) { LogFlowFunc((DEVICE_NAME ":_fini\n")); /* * Undo the work we did at start (in the reverse order). */ int rc = mod_remove(&g_VBoxDrvSolarisModLinkage); if (rc != 0) return rc; supdrvDeleteDevExt(&g_DevExt); rc = RTSpinlockDestroy(g_Spinlock); AssertRC(rc); g_Spinlock = NIL_RTSPINLOCK; RTR0TermForced(); memset(&g_DevExt, 0, sizeof(g_DevExt)); ddi_soft_state_fini(&g_pVBoxDrvSolarisState); return 0; }
int _fini(void) { int error; if ((error = mod_remove(&modlinkage)) == 0) ddi_soft_state_fini(&sbbcp); master_chosen = FALSE; mutex_destroy(&chosen_lock); /* * remove the mailbox */ sbbc_mbox_fini(); /* * remove the iosram driver */ iosram_fini(); return (error); }
int _fini(void) { return mod_remove(&modlinkage); }
int _fini(void) { mutex_destroy(&sc_gptwo_config_list_lock); return (mod_remove(&modlinkage)); }
int _fini(void) { return (mod_remove(&ml)); }
int _fini(void) { return (mod_remove(&spuni_modlinkage)); }
int _fini() { return (mod_remove(&modlinkage)); }
int _fini(void) { DBG(CE_CONT,"tun: _fini\n"); return mod_remove(&modlinkage); }
extern int modprobe_main(int argc, char** argv) { int opt; int remove_opt = 0; autoclean = show_only = quiet = do_syslog = verbose = 0; while ((opt = getopt(argc, argv, "acdklnqrst:vVC:")) != -1) { switch(opt) { case 'c': // no config used case 'l': // no pattern matching return EXIT_SUCCESS; break; case 'C': // no config used case 't': // no pattern matching error_msg_and_die("-t and -C not supported"); case 'a': // ignore case 'd': // ignore break; case 'k': autoclean++; break; case 'n': show_only++; break; case 'q': quiet++; break; case 'r': remove_opt++; break; case 's': do_syslog++; break; case 'v': verbose++; break; case 'V': default: show_usage(); break; } } depend = build_dep ( ); if ( !depend ) error_msg_and_die ( "could not parse modules.dep\n" ); if (remove_opt) { do { mod_remove ( optind < argc ? xstrdup ( argv [optind] ) : 0 ); } while ( ++optind < argc ); return EXIT_SUCCESS; } if (optind >= argc) error_msg_and_die ( "No module or pattern provided\n" ); return mod_insert ( xstrdup ( argv [optind] ), argc - optind - 1, argv + optind + 1 ) ? \ EXIT_FAILURE : EXIT_SUCCESS; }
int _fini(void) { cmn_err(CE_NOTE, "Inside _fini"); return(mod_remove(&ml)); }
int _fini(void) { return (mod_remove(&jmodlinkage)); }
int _init(void) { mboxsc_timeout_range_t timeout_range; int ret; SCKM_DEBUG0(D_INIT, "in _init"); /* * Initialize outgoing mailbox (KDSC) */ if ((ret = mboxsc_init(KEY_KDSC, MBOXSC_MBOX_OUT, NULL)) != 0) { cmn_err(CE_WARN, "failed initializing outgoing mailbox " "(%d)", ret); return (ret); } /* * Initialize incoming mailbox (SCKD) */ if ((ret = mboxsc_init(KEY_SCKD, MBOXSC_MBOX_IN, sckm_mbox_callback)) != 0) { cmn_err(CE_WARN, "failed initializing incoming mailbox " "(%d)\n", ret); mboxsc_fini(KEY_KDSC); return (ret); } if ((ret = mboxsc_ctrl(KEY_SCKD, MBOXSC_CMD_GETMSG_TIMEOUT_RANGE, (void *)&timeout_range)) != 0) { mboxsc_fini(KEY_SCKD); mboxsc_fini(KEY_KDSC); return (ret); } if (sckm_getmsg_timeout < timeout_range.min_timeout) { sckm_getmsg_timeout = timeout_range.min_timeout; cmn_err(CE_WARN, "resetting getmsg timeout to %lx", sckm_getmsg_timeout); } if (sckm_getmsg_timeout > timeout_range.max_timeout) { sckm_getmsg_timeout = timeout_range.max_timeout; cmn_err(CE_WARN, "resetting getmsg timeout to %lx", sckm_getmsg_timeout); } if ((ret = mod_install(&modlinkage)) != 0) { mboxsc_fini(KEY_KDSC); mboxsc_fini(KEY_SCKD); return (ret); } /* * Initialize variables needed for synchronization with daemon. */ sckm_udata.buf = kmem_alloc(SCKM_SCKD_MAXDATA, KM_SLEEP); req_data = (sckm_mbox_req_hdr_t *)kmem_alloc(SCKM_SCKD_MAXDATA, KM_SLEEP); rep_data = (sckm_mbox_rep_hdr_t *)kmem_alloc(SCKM_KDSC_MAXDATA, KM_SLEEP); if ((sckm_udata.buf == NULL) || (req_data == NULL) || (rep_data == NULL)) { cmn_err(CE_WARN, "not enough memory during _init"); /* free what was successfully allocated */ if (sckm_udata.buf != NULL) kmem_free(sckm_udata.buf, SCKM_SCKD_MAXDATA); if (req_data != NULL) kmem_free(req_data, SCKM_SCKD_MAXDATA); if (rep_data != NULL) kmem_free(rep_data, SCKM_KDSC_MAXDATA); sckm_udata.buf = NULL; req_data = NULL; rep_data = NULL; /* uninitialize mailboxes, remove module, and return error */ mboxsc_fini(KEY_KDSC); mboxsc_fini(KEY_SCKD); mod_remove(&modlinkage); return (-1); } cv_init(&sckm_udata_cv, NULL, CV_DRIVER, NULL); cv_init(&sckm_cons_cv, NULL, CV_DRIVER, NULL); mutex_init(&sckm_umutex, NULL, MUTEX_DRIVER, NULL); /* * Create mutex for task processing, protection of taskq * pointer, and create taskq. */ mutex_init(&sckm_task_mutex, NULL, MUTEX_DRIVER, NULL); mutex_init(&sckm_taskq_ptr_mutex, NULL, MUTEX_DRIVER, NULL); sckm_taskq = taskq_create("sckm_taskq", 1, minclsyspri, SCKM_NUM_TASKQ, SCKM_NUM_TASKQ, TASKQ_PREPOPULATE); SCKM_DEBUG1(D_INIT, "out _init ret=%d\n", ret); return (ret); }