Changeset ab87db5 in mainline for uspace/lib/c/generic/async/server.c


Ignore:
Timestamp:
2019-02-23T17:16:01Z (6 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8c193d83, ca0e838
Parents:
bc417660 (diff), 95a47b0 (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.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-23 17:16:01)
git-committer:
GitHub <noreply@…> (2019-02-23 17:16:01)
Message:

Merge pull request #157

Turn some function-like macros into functions

File:
1 edited

Legend:

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

    rbc417660 rab87db5  
    546546        errno_t rc = mpsc_send(conn->msg_channel, call);
    547547
    548         if (IPC_GET_IMETHOD(*call) == IPC_M_PHONE_HUNGUP) {
     548        if (ipc_get_imethod(call) == IPC_M_PHONE_HUNGUP) {
    549549                /* Close the channel, but let the connection fibril answer. */
    550550                mpsc_close(conn->msg_channel);
     
    656656        }
    657657
    658         ht_link_t *link = hash_table_find(&notification_hash_table,
    659             &IPC_GET_IMETHOD(*call));
     658        sysarg_t imethod = ipc_get_imethod(call);
     659        ht_link_t *link = hash_table_find(&notification_hash_table, &imethod);
    660660        if (!link) {
    661661                /* Invalid notification. */
     
    871871
    872872                memset(call, 0, sizeof(ipc_call_t));
    873                 IPC_SET_IMETHOD(*call, IPC_M_PHONE_HUNGUP);
     873                ipc_set_imethod(call, IPC_M_PHONE_HUNGUP);
    874874                call->cap_handle = CAP_NIL;
    875875        }
     
    944944
    945945        /* New connection */
    946         if (IPC_GET_IMETHOD(*call) == IPC_M_CONNECT_ME_TO) {
     946        if (ipc_get_imethod(call) == IPC_M_CONNECT_ME_TO) {
    947947                connection_t *conn = calloc(1, sizeof(*conn));
    948948                if (!conn) {
     
    951951                }
    952952
    953                 iface_t iface = (iface_t) IPC_GET_ARG1(*call);
     953                iface_t iface = (iface_t) ipc_get_arg1(call);
    954954
    955955                // TODO: Currently ignores all ports but the first one.
     
    12211221        async_get_call(call);
    12221222
    1223         if (IPC_GET_IMETHOD(*call) != IPC_M_SHARE_IN)
     1223        if (ipc_get_imethod(call) != IPC_M_SHARE_IN)
    12241224                return false;
    12251225
    1226         *size = (size_t) IPC_GET_ARG1(*call);
     1226        *size = (size_t) ipc_get_arg1(call);
    12271227        return true;
    12281228}
     
    12761276        async_get_call(call);
    12771277
    1278         if (IPC_GET_IMETHOD(*call) != IPC_M_SHARE_OUT)
     1278        if (ipc_get_imethod(call) != IPC_M_SHARE_OUT)
    12791279                return false;
    12801280
    1281         *size = (size_t) IPC_GET_ARG2(*call);
    1282         *flags = (unsigned int) IPC_GET_ARG3(*call);
     1281        *size = (size_t) ipc_get_arg2(call);
     1282        *flags = (unsigned int) ipc_get_arg3(call);
    12831283        return true;
    12841284}
     
    13291329        async_get_call(call);
    13301330
    1331         if (IPC_GET_IMETHOD(*call) != IPC_M_DATA_READ)
     1331        if (ipc_get_imethod(call) != IPC_M_DATA_READ)
    13321332                return false;
    13331333
    13341334        if (size)
    1335                 *size = (size_t) IPC_GET_ARG2(*call);
     1335                *size = (size_t) ipc_get_arg2(call);
    13361336
    13371337        return true;
     
    14881488        async_get_call(call);
    14891489
    1490         if (IPC_GET_IMETHOD(*call) != IPC_M_DATA_WRITE)
     1490        if (ipc_get_imethod(call) != IPC_M_DATA_WRITE)
    14911491                return false;
    14921492
    14931493        if (size)
    1494                 *size = (size_t) IPC_GET_ARG2(*call);
     1494                *size = (size_t) ipc_get_arg2(call);
    14951495
    14961496        return true;
     
    17321732        async_get_call(&call);
    17331733
    1734         cap_phone_handle_t phandle = (cap_handle_t) IPC_GET_ARG5(call);
    1735 
    1736         if ((IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) ||
    1737             !CAP_HANDLE_VALID((phandle))) {
     1734        cap_phone_handle_t phandle = (cap_handle_t) ipc_get_arg5(&call);
     1735
     1736        if ((ipc_get_imethod(&call) != IPC_M_CONNECT_TO_ME) ||
     1737            !cap_handle_valid((phandle))) {
    17381738                async_answer_0(&call, EINVAL);
    17391739                return NULL;
     
    17761776async_sess_t *async_callback_receive_start(exch_mgmt_t mgmt, ipc_call_t *call)
    17771777{
    1778         cap_phone_handle_t phandle = (cap_handle_t) IPC_GET_ARG5(*call);
    1779 
    1780         if ((IPC_GET_IMETHOD(*call) != IPC_M_CONNECT_TO_ME) ||
    1781             !CAP_HANDLE_VALID((phandle)))
     1778        cap_phone_handle_t phandle = (cap_handle_t) ipc_get_arg5(call);
     1779
     1780        if ((ipc_get_imethod(call) != IPC_M_CONNECT_TO_ME) ||
     1781            !cap_handle_valid((phandle)))
    17821782                return NULL;
    17831783
     
    18031803        async_get_call(call);
    18041804
    1805         if (IPC_GET_IMETHOD(*call) != IPC_M_STATE_CHANGE_AUTHORIZE)
     1805        if (ipc_get_imethod(call) != IPC_M_STATE_CHANGE_AUTHORIZE)
    18061806                return false;
    18071807
     
    18131813        assert(call);
    18141814
    1815         return async_answer_1(call, EOK, CAP_HANDLE_RAW(other_exch->phone));
     1815        return async_answer_1(call, EOK, cap_handle_raw(other_exch->phone));
    18161816}
    18171817
Note: See TracChangeset for help on using the changeset viewer.