Changeset d054ad3 in mainline for uspace/lib/c/generic/async/client.c


Ignore:
Timestamp:
2018-07-09T18:36:33Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d56e2e
Parents:
87337dc5
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-05 16:39:15)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-09 18:36:33)
Message:

Remove the obsolete callback abstraction from low level IPC.

File:
1 edited

Legend:

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

    r87337dc5 rd054ad3  
    241241 *
    242242 */
    243 static void reply_received(void *arg, errno_t retval, ipc_call_t *data)
    244 {
    245         assert(arg);
     243void async_reply_received(ipc_call_t *data)
     244{
     245        amsg_t *msg = data->label;
     246        if (!msg)
     247                return;
    246248
    247249        futex_lock(&async_futex);
    248250
    249         amsg_t *msg = (amsg_t *) arg;
    250         msg->retval = retval;
     251        msg->retval = IPC_GET_RETVAL(*data);
    251252
    252253        /* Copy data after futex_down, just in case the call was detached */
     
    302303        msg->wdata.active = true;
    303304
    304         ipc_call_async_4(exch->phone, imethod, arg1, arg2, arg3, arg4, msg,
    305             reply_received);
     305        errno_t rc = ipc_call_async_4(exch->phone, imethod, arg1, arg2, arg3,
     306            arg4, msg);
     307        if (rc != EOK) {
     308                msg->retval = rc;
     309                msg->done = true;
     310        }
    306311
    307312        return (aid_t) msg;
     
    340345        msg->wdata.active = true;
    341346
    342         ipc_call_async_5(exch->phone, imethod, arg1, arg2, arg3, arg4, arg5,
    343             msg, reply_received);
     347        errno_t rc = ipc_call_async_5(exch->phone, imethod, arg1, arg2, arg3,
     348            arg4, arg5, msg);
     349        if (rc != EOK) {
     350                msg->retval = rc;
     351                msg->done = true;
     352        }
    344353
    345354        return (aid_t) msg;
     
    653662{
    654663        if (exch != NULL)
    655                 ipc_call_async_0(exch->phone, imethod, NULL, NULL);
     664                ipc_call_async_0(exch->phone, imethod, NULL);
    656665}
    657666
     
    659668{
    660669        if (exch != NULL)
    661                 ipc_call_async_1(exch->phone, imethod, arg1, NULL, NULL);
     670                ipc_call_async_1(exch->phone, imethod, arg1, NULL);
    662671}
    663672
     
    666675{
    667676        if (exch != NULL)
    668                 ipc_call_async_2(exch->phone, imethod, arg1, arg2, NULL, NULL);
     677                ipc_call_async_2(exch->phone, imethod, arg1, arg2, NULL);
    669678}
    670679
     
    673682{
    674683        if (exch != NULL)
    675                 ipc_call_async_3(exch->phone, imethod, arg1, arg2, arg3, NULL,
    676                     NULL);
     684                ipc_call_async_3(exch->phone, imethod, arg1, arg2, arg3, NULL);
    677685}
    678686
     
    682690        if (exch != NULL)
    683691                ipc_call_async_4(exch->phone, imethod, arg1, arg2, arg3, arg4,
    684                     NULL, NULL);
     692                    NULL);
    685693}
    686694
     
    690698        if (exch != NULL)
    691699                ipc_call_async_5(exch->phone, imethod, arg1, arg2, arg3, arg4,
    692                     arg5, NULL, NULL);
     700                    arg5, NULL);
    693701}
    694702
     
    710718        msg->wdata.active = true;
    711719
    712         ipc_call_async_4(phone, IPC_M_CONNECT_ME_TO, (sysarg_t) iface, arg2,
    713             arg3, flags, msg, reply_received);
    714 
    715         errno_t rc;
     720        errno_t rc = ipc_call_async_4(phone, IPC_M_CONNECT_ME_TO,
     721            (sysarg_t) iface, arg2, arg3, flags, msg);
     722        if (rc != EOK) {
     723                msg->retval = rc;
     724                msg->done = true;
     725        }
     726
    716727        async_wait_for((aid_t) msg, &rc);
    717728
Note: See TracChangeset for help on using the changeset viewer.