Lines Matching refs:mp

46 	topo_imethod_t *mp;
48 for (mp = topo_list_next(&node->tn_methods); mp != NULL;
49 mp = topo_list_next(mp)) {
50 if (strcmp(name, mp->tim_name) == 0) {
52 return (mp);
67 topo_imethod_t *mp;
70 for (mp = topo_list_next(&node->tn_methods); mp != NULL;
71 mp = topo_list_next(mp)) {
72 if ((strcmp(name, mp->tim_name) == 0) &&
73 (vers == mp->tim_version)) {
83 topo_method_enter(topo_imethod_t *mp)
85 (void) pthread_mutex_lock(&mp->tim_lock);
87 while (mp->tim_busy != 0)
88 (void) pthread_cond_wait(&mp->tim_cv, &mp->tim_lock);
90 ++mp->tim_busy;
92 (void) pthread_mutex_unlock(&mp->tim_lock);
96 topo_method_exit(topo_imethod_t *mp)
98 (void) pthread_mutex_lock(&mp->tim_lock);
99 --mp->tim_busy;
101 assert(mp->tim_busy == 0);
103 (void) pthread_cond_broadcast(&mp->tim_cv);
104 (void) pthread_mutex_unlock(&mp->tim_lock);
108 set_methregister_error(topo_mod_t *mod, tnode_t *node, topo_imethod_t *mp,
111 if (mp != NULL) {
112 topo_list_delete(&node->tn_methods, mp);
113 if (mp->tim_name != NULL)
114 topo_mod_strfree(mod, mp->tim_name);
115 if (mp->tim_desc != NULL)
116 topo_mod_strfree(mod, mp->tim_desc);
118 topo_mod_free(mod, mp, sizeof (topo_imethod_t));
131 topo_method_register(topo_mod_t *mod, tnode_t *node, const topo_method_t *mp)
139 for (meth = &mp[0]; meth->tm_name != NULL; meth++) {
190 topo_imethod_t *mp;
193 for (mp = topo_list_next(&node->tn_methods); mp != NULL;
194 mp = topo_list_next(mp)) {
195 if (strcmp(name, mp->tim_name) == 0)
199 if (mp == NULL) {
204 topo_list_delete(&node->tn_methods, mp);
207 if (mp->tim_name != NULL)
208 topo_mod_strfree(mod, mp->tim_name);
209 if (mp->tim_desc != NULL)
210 topo_mod_strfree(mod, mp->tim_desc);
212 topo_mod_free(mod, mp, sizeof (topo_imethod_t));
218 topo_imethod_t *mp;
221 while ((mp = topo_list_next(&node->tn_methods)) != NULL) {
222 topo_list_delete(&node->tn_methods, mp);
223 if (mp->tim_name != NULL)
224 topo_mod_strfree(mod, mp->tim_name);
225 if (mp->tim_desc != NULL)
226 topo_mod_strfree(mod, mp->tim_desc);
227 topo_mod_free(mod, mp, sizeof (topo_imethod_t));
238 topo_imethod_t *mp;
240 for (mp = topo_list_next(&node->tn_methods); mp != NULL;
241 mp = topo_list_next(mp)) {
242 if (strcmp(method, mp->tim_name) != 0)
245 if (version < mp->tim_version) {
248 } else if (version > mp->tim_version) {
253 topo_method_enter(mp);
254 save = mp->tim_mod->tm_errno;
255 mp->tim_mod->tm_errno = 0;
256 if ((rc = mp->tim_func(mp->tim_mod, node, version, in, out))
258 if (mp->tim_mod->tm_errno == 0)
261 *err = mp->tim_mod->tm_errno;
263 mp->tim_mod->tm_errno = save;
264 topo_method_exit(mp);