Changeset 23b7c02 in mainline for uspace/lib/c/generic/async.c
- Timestamp:
- 2013-09-04T06:58:57Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7664469
- Parents:
- caf5382 (diff), aa2a049 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async.c
rcaf5382 r23b7c02 2281 2281 bool async_data_read_receive(ipc_callid_t *callid, size_t *size) 2282 2282 { 2283 ipc_call_t data; 2284 return async_data_read_receive_call(callid, &data, size); 2285 } 2286 2287 /** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework. 2288 * 2289 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ 2290 * calls so that the user doesn't have to remember the meaning of each IPC 2291 * argument. 2292 * 2293 * So far, this wrapper is to be used from within a connection fibril. 2294 * 2295 * @param callid Storage for the hash of the IPC_M_DATA_READ. 2296 * @param size Storage for the maximum size. Can be NULL. 2297 * 2298 * @return True on success, false on failure. 2299 * 2300 */ 2301 bool async_data_read_receive_call(ipc_callid_t *callid, ipc_call_t *data, 2302 size_t *size) 2303 { 2283 2304 assert(callid); 2284 2285 ipc_call_t data;2286 *callid = async_get_call( &data);2287 2288 if (IPC_GET_IMETHOD( data) != IPC_M_DATA_READ)2305 assert(data); 2306 2307 *callid = async_get_call(data); 2308 2309 if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_READ) 2289 2310 return false; 2290 2311 2291 2312 if (size) 2292 *size = (size_t) IPC_GET_ARG2( data);2313 *size = (size_t) IPC_GET_ARG2(*data); 2293 2314 2294 2315 return true; … … 2385 2406 bool async_data_write_receive(ipc_callid_t *callid, size_t *size) 2386 2407 { 2408 ipc_call_t data; 2409 return async_data_write_receive_call(callid, &data, size); 2410 } 2411 2412 /** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework. 2413 * 2414 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE 2415 * calls so that the user doesn't have to remember the meaning of each IPC 2416 * argument. 2417 * 2418 * So far, this wrapper is to be used from within a connection fibril. 2419 * 2420 * @param callid Storage for the hash of the IPC_M_DATA_WRITE. 2421 * @param data Storage for the ipc call data. 2422 * @param size Storage for the suggested size. May be NULL. 2423 * 2424 * @return True on success, false on failure. 2425 * 2426 */ 2427 bool async_data_write_receive_call(ipc_callid_t *callid, ipc_call_t *data, 2428 size_t *size) 2429 { 2387 2430 assert(callid); 2388 2389 ipc_call_t data;2390 *callid = async_get_call( &data);2391 2392 if (IPC_GET_IMETHOD( data) != IPC_M_DATA_WRITE)2431 assert(data); 2432 2433 *callid = async_get_call(data); 2434 2435 if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_WRITE) 2393 2436 return false; 2394 2437 2395 2438 if (size) 2396 *size = (size_t) IPC_GET_ARG2( data);2439 *size = (size_t) IPC_GET_ARG2(*data); 2397 2440 2398 2441 return true;
Note:
See TracChangeset
for help on using the changeset viewer.