Ignore:
File:
1 edited

Legend:

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

    rae66564 r466e95f7  
    106106{
    107107        switch (imethod) {
    108         case IPC_M_PAGE_IN:
    109108        case IPC_M_SHARE_OUT:
    110109        case IPC_M_SHARE_IN:
     
    138137        case IPC_M_CONNECT_TO_ME:
    139138        case IPC_M_CONNECT_ME_TO:
    140         case IPC_M_PAGE_IN:
    141139        case IPC_M_SHARE_OUT:
    142140        case IPC_M_SHARE_IN:
     
    259257{
    260258        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  * @param priv        Value to be stored in call->priv.
    268  *
    269  * @return EOK on success.
    270  * @return ENOENT if there is no such phone handle.
    271  *
    272  */
    273 int ipc_req_internal(int phoneid, ipc_data_t *data, sysarg_t priv)
    274 {
    275         phone_t *phone;
    276         if (phone_get(phoneid, &phone) != EOK)
    277                 return ENOENT;
    278        
    279         call_t *call = ipc_call_alloc(0);
    280         call->priv = priv;
    281         memcpy(call->data.args, data->args, sizeof(data->args));
    282        
    283         int rc = request_preprocess(call, phone);
    284         if (!rc) {
    285 #ifdef CONFIG_UDEBUG
    286                 udebug_stoppable_begin();
    287 #endif
    288 
    289                 ipc_call_hold(call);
    290                 rc = ipc_call_sync(phone, call);
    291                 spinlock_lock(&call->forget_lock);
    292                 bool forgotten = call->forget;
    293                 spinlock_unlock(&call->forget_lock);
    294                 ipc_call_release(call);
    295 
    296 #ifdef CONFIG_UDEBUG
    297                 udebug_stoppable_end();
    298 #endif
    299 
    300                 if (rc != EOK) {
    301                         if (!forgotten) {
    302                                 /*
    303                                  * There was an error, but it did not result
    304                                  * in the call being forgotten. In fact, the
    305                                  * call was not even sent. We are still
    306                                  * its owners and are responsible for its
    307                                  * deallocation.
    308                                  */
    309                                 ipc_call_free(call);
    310                         } else {
    311                                 /*
    312                                  * The call was forgotten and it changed hands.
    313                                  * We are no longer expected to free it.
    314                                  */
    315                                 ASSERT(rc == EINTR);
    316                         }
    317                         return rc;     
    318                 }
    319 
    320                 process_answer(call);
    321         } else
    322                 IPC_SET_RETVAL(call->data, rc);
    323        
    324         memcpy(data->args, call->data.args, sizeof(data->args));
    325         ipc_call_free(call);
    326        
    327         return EOK;
    328259}
    329260
     
    457388{
    458389        call_t *call = get_call(callid);
     390        phone_t *phone;
     391        bool need_old = answer_need_old(call);
     392        bool after_forward = false;
     393        ipc_data_t old;
     394        int rc;
     395
    459396        if (!call)
    460397                return ENOENT;
    461        
    462         ipc_data_t old;
    463         bool need_old = answer_need_old(call);
     398
    464399        if (need_old)
    465400                old = call->data;
    466        
    467         bool after_forward = false;
    468         int rc;
    469         phone_t *phone;
    470401       
    471402        if (phone_get(phoneid, &phone) != EOK) {
     
    478409                goto error;
    479410        }
    480        
     411
    481412        call->flags |= IPC_CALL_FORWARDED;
    482413       
     
    805736 * @param ucode   Uspace pointer to the top-half pseudocode.
    806737 *
    807  * @return EPERM or a return code returned by ipc_irq_subscribe().
    808  *
    809  */
    810 sysarg_t sys_ipc_irq_subscribe(inr_t inr, devno_t devno, sysarg_t imethod,
     738 * @return EPERM or a return code returned by ipc_irq_register().
     739 *
     740 */
     741sysarg_t sys_irq_register(inr_t inr, devno_t devno, sysarg_t imethod,
    811742    irq_code_t *ucode)
    812743{
     
    814745                return EPERM;
    815746       
    816         return ipc_irq_subscribe(&TASK->answerbox, inr, devno, imethod, ucode);
     747        return ipc_irq_register(&TASK->answerbox, inr, devno, imethod, ucode);
    817748}
    818749
     
    825756 *
    826757 */
    827 sysarg_t sys_ipc_irq_unsubscribe(inr_t inr, devno_t devno)
     758sysarg_t sys_irq_unregister(inr_t inr, devno_t devno)
    828759{
    829760        if (!(cap_get(TASK) & CAP_IRQ_REG))
    830761                return EPERM;
    831762       
    832         ipc_irq_unsubscribe(&TASK->answerbox, inr, devno);
     763        ipc_irq_unregister(&TASK->answerbox, inr, devno);
    833764       
    834765        return 0;
Note: See TracChangeset for help on using the changeset viewer.