Changeset 2c2d54a in mainline for kernel/generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2016-09-02T17:58:05Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4c3602c4
Parents:
4bf0926e (diff), 3233adb (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:

Merge from lp:~jakub/helenos/pager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r4bf0926e r2c2d54a  
    106106{
    107107        switch (imethod) {
     108        case IPC_M_PAGE_IN:
    108109        case IPC_M_SHARE_OUT:
    109110        case IPC_M_SHARE_IN:
     
    137138        case IPC_M_CONNECT_TO_ME:
    138139        case IPC_M_CONNECT_ME_TO:
     140        case IPC_M_PAGE_IN:
    139141        case IPC_M_SHARE_OUT:
    140142        case IPC_M_SHARE_IN:
     
    257259{
    258260        return SYSIPC_OP(request_process, call, box);
     261}
     262
     263/** Make a call over IPC and wait for reply.
     264 *
     265 * @param phoneid     Phone handle for the call.
     266 * @param data[inout] Structure with request/reply data.
     267 *
     268 * @return EOK on success.
     269 * @return ENOENT if there is no such phone handle.
     270 *
     271 */
     272int ipc_req_internal(int phoneid, ipc_data_t *data)
     273{
     274        phone_t *phone;
     275        if (phone_get(phoneid, &phone) != EOK)
     276                return ENOENT;
     277       
     278        call_t *call = ipc_call_alloc(0);
     279        memcpy(call->data.args, data->args, sizeof(data->args));
     280       
     281        int rc = request_preprocess(call, phone);
     282        if (!rc) {
     283#ifdef CONFIG_UDEBUG
     284                udebug_stoppable_begin();
     285#endif
     286
     287                rc = ipc_call_sync(phone, call);
     288
     289#ifdef CONFIG_UDEBUG
     290                udebug_stoppable_end();
     291#endif
     292
     293                if (rc != EOK)
     294                        return EINTR;
     295
     296                process_answer(call);
     297        } else
     298                IPC_SET_RETVAL(call->data, rc);
     299       
     300        memcpy(data->args, call->data.args, sizeof(data->args));
     301        ipc_call_free(call);
     302       
     303        return EOK;
    259304}
    260305
Note: See TracChangeset for help on using the changeset viewer.