Changeset 802898f in mainline for uspace/lib/c/generic/async.c


Ignore:
Timestamp:
2013-09-02T20:14:11Z (11 years ago)
Author:
Dominik Taborsky (AT DOT) <brembyseznamcz>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8c95dff
Parents:
0435fe41 (diff), 61ab4a9 (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.
Message:

mainline update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    r0435fe41 r802898f  
    22812281bool async_data_read_receive(ipc_callid_t *callid, size_t *size)
    22822282{
     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 */
     2301bool async_data_read_receive_call(ipc_callid_t *callid, ipc_call_t *data,
     2302    size_t *size)
     2303{
    22832304        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)
    22892310                return false;
    22902311       
    22912312        if (size)
    2292                 *size = (size_t) IPC_GET_ARG2(data);
     2313                *size = (size_t) IPC_GET_ARG2(*data);
    22932314       
    22942315        return true;
     
    23852406bool async_data_write_receive(ipc_callid_t *callid, size_t *size)
    23862407{
     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 */
     2427bool async_data_write_receive_call(ipc_callid_t *callid, ipc_call_t *data,
     2428    size_t *size)
     2429{
    23872430        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)
    23932436                return false;
    23942437       
    23952438        if (size)
    2396                 *size = (size_t) IPC_GET_ARG2(data);
     2439                *size = (size_t) IPC_GET_ARG2(*data);
    23972440       
    23982441        return true;
Note: See TracChangeset for help on using the changeset viewer.