Changeset 691d8d8 in mainline


Ignore:
Timestamp:
2012-08-15T13:17:49Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2405bb5
Parents:
924c2530
Message:

Give each system IPC method its dedicated request process hook.

File:
1 edited

Legend:

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

    r924c2530 r691d8d8  
    711711}
    712712
     713static int r_process_m_connect_to_me(answerbox_t *box, call_t *call)
     714{
     715        int phoneid = phone_alloc(TASK);
     716
     717        if (phoneid < 0) {  /* Failed to allocate phone */
     718                IPC_SET_RETVAL(call->data, ELIMIT);
     719                ipc_answer(box, call);
     720                return -1;
     721        }
     722               
     723        IPC_SET_ARG5(call->data, phoneid);
     724       
     725        return EOK;
     726}
     727
     728static int r_process_m_debug(answerbox_t *box, call_t *call)
     729{
     730        return -1;
     731}
     732
    713733/** Do basic kernel processing of received call request.
    714734 *
     
    722742static int process_request(answerbox_t *box, call_t *call)
    723743{
    724         if (IPC_GET_IMETHOD(call->data) == IPC_M_CONNECT_TO_ME) {
    725                 int phoneid = phone_alloc(TASK);
    726                 if (phoneid < 0) {  /* Failed to allocate phone */
    727                         IPC_SET_RETVAL(call->data, ELIMIT);
    728                         ipc_answer(box, call);
    729                         return -1;
    730                 }
    731                
    732                 IPC_SET_ARG5(call->data, phoneid);
    733         }
    734        
     744        int rc = EOK;
     745
    735746        switch (IPC_GET_IMETHOD(call->data)) {
     747        case IPC_M_CONNECT_TO_ME:
     748                rc = r_process_m_connect_to_me(box, call);
     749                break;
    736750        case IPC_M_DEBUG:
    737                 return -1;
     751                rc = r_process_m_debug(box, call);
     752                break;
    738753        default:
    739754                break;
    740755        }
    741756       
    742         return 0;
     757        return rc;
    743758}
    744759
Note: See TracChangeset for help on using the changeset viewer.