Changeset b670523 in mainline for uspace/lib
- Timestamp:
- 2011-06-09T20:42:27Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ec25a6
- Parents:
- 503e4e3 (diff), 390d80d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib/c
- Files:
-
- 3 edited
-
generic/async.c (modified) (2 diffs)
-
generic/devman.c (modified) (3 diffs)
-
include/async.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async.c
r503e4e3 rb670523 2339 2339 * @param mgmt Exchange management style. 2340 2340 * 2341 * @return New async session or NULL on failure. 2341 * @return New async session. 2342 * @return NULL on failure. 2342 2343 * 2343 2344 */ … … 2377 2378 } 2378 2379 2380 /** Wrapper for receiving the IPC_M_CONNECT_TO_ME calls. 2381 * 2382 * If the call is IPC_M_CONNECT_TO_ME then a new 2383 * async session is created. However, the phone is 2384 * not accepted automatically. 2385 * 2386 * @param mgmt Exchange management style. 2387 * @param call Call data. 2388 * 2389 * @return New async session. 2390 * @return NULL on failure. 2391 * @return NULL if the call is not IPC_M_CONNECT_TO_ME. 2392 * 2393 */ 2394 async_sess_t *async_callback_receive_start(exch_mgmt_t mgmt, ipc_call_t *call) 2395 { 2396 int phone = (int) IPC_GET_ARG5(*call); 2397 2398 if ((IPC_GET_IMETHOD(*call) != IPC_M_CONNECT_TO_ME) || 2399 (phone < 0)) 2400 return NULL; 2401 2402 async_sess_t *sess = (async_sess_t *) malloc(sizeof(async_sess_t)); 2403 if (sess == NULL) 2404 return NULL; 2405 2406 sess->mgmt = mgmt; 2407 sess->phone = phone; 2408 sess->arg1 = 0; 2409 sess->arg2 = 0; 2410 sess->arg3 = 0; 2411 2412 list_initialize(&sess->exch_list); 2413 fibril_mutex_initialize(&sess->mutex); 2414 atomic_set(&sess->refcnt, 0); 2415 2416 return sess; 2417 } 2418 2379 2419 /** @} 2380 2420 */ -
uspace/lib/c/generic/devman.c
r503e4e3 rb670523 231 231 } 232 232 233 async_wait_for(req, &retval);234 if (retval != EOK) {235 devman_exchange_end(exch);236 237 if (funh != NULL)238 *funh = -1;239 240 return retval;241 }242 243 if (funh != NULL)244 *funh = (int) IPC_GET_ARG1(answer);245 246 233 link_t *link = match_ids->ids.next; 247 234 match_id_t *match_id = NULL; … … 250 237 match_id = list_get_instance(link, match_id_t, link); 251 238 252 ipc_call_t answer ;253 aid_t req = async_send_1(exch, DEVMAN_ADD_MATCH_ID,254 match_id->score, &answer );239 ipc_call_t answer2; 240 aid_t req2 = async_send_1(exch, DEVMAN_ADD_MATCH_ID, 241 match_id->score, &answer2); 255 242 retval = async_data_write_start(exch, match_id->id, 256 243 str_size(match_id->id)); 244 if (retval != EOK) { 245 devman_exchange_end(exch); 246 async_wait_for(req2, NULL); 247 async_wait_for(req, NULL); 248 return retval; 249 } 250 251 async_wait_for(req2, &retval); 257 252 if (retval != EOK) { 258 253 devman_exchange_end(exch); … … 261 256 } 262 257 263 async_wait_for(req, &retval);264 if (retval != EOK) {265 devman_exchange_end(exch);266 return retval;267 }268 269 258 link = link->next; 270 259 } 271 260 272 261 devman_exchange_end(exch); 273 return EOK; 262 263 async_wait_for(req, &retval); 264 if (retval == EOK) { 265 if (funh != NULL) 266 *funh = (int) IPC_GET_ARG1(answer); 267 } else { 268 if (funh != NULL) 269 *funh = -1; 270 } 271 272 return retval; 274 273 } 275 274 -
uspace/lib/c/include/async.h
r503e4e3 rb670523 464 464 extern async_sess_t *async_clone_receive(exch_mgmt_t); 465 465 extern async_sess_t *async_callback_receive(exch_mgmt_t); 466 extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *); 466 467 467 468 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
