fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mutex_init(&nskernd_lock, NULL, MUTEX_DRIVER, NULL);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (nskernd_norun != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) drv_getparm(UPROCP, (void *)&proc_nskernd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * must be called with nskernd_lock held.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte while (nskernd_u_wait == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nskernd_kdata.data1 = (uint64_t)1; /* kernel has done cleanup */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortenskernd_command(intptr_t arg, int mode, int *rvalp)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyin((void *)arg, udata, sizeof (*udata), mode) < 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case NSKERND_STOP: /* User program requesting stop */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cv_wait_sig(&nskernd_u_cv, &nskernd_lock) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * woken by cv_signal() or cv_broadcast()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * signal - the user process has blocked all
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * signals except for SIGTERM and the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * uncatchables, so the process is about to die
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and we need to clean up.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save kmem by freeing the udata structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save kmem by freeing the udata structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cmn_err(CE_WARN, "nskernd: unknown command %d", udata->command);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This function is included for SV ioctl processing only.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (drv_getparm(UPROCP, (void *)&this_proc) != 0)