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
716c180559045549271833327182dc6a266134f1Nattuvetty Bhavyan * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Called by the common layer to request the plugin to call
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a client application's callback (pClientFn) when a visibility change
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is detected for the given object type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteMP_RegisterForObjectVisibilityChangesPlugin(MP_OBJECT_VISIBILITY_FN pClientFn,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - enter");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Validate the object type passes in within range */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - objectType is invalid");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - error exit");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - objectType is invalid");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - error exit");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Init sysevents if they have not been initialized yet */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check to see if we are going to be replacing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (g_Visibility_Callback_List[objectType].pClientFn != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Add the registration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte g_Visibility_Callback_List[objectType].pClientFn = pClientFn;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte g_Visibility_Callback_List[objectType].pCallerData = pCallerData;
4f4863587e52ddab00c1f01266a9198314761416Nattuvetty Bhavyan (void) pthread_mutex_unlock(&g_visa_mutex);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - returning MP_STATUS_FN_REPLACED");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log(LOG_INFO, "MP_RegisterForObjectVisibilityChangesPlugin()",