Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/concttome.c

    r8e3153b r5a6cc679  
    4343{
    4444        cap_handle_t phone_handle;
    45         kobject_t *phone_obj;
    46         errno_t rc = phone_alloc(TASK, false, &phone_handle, &phone_obj);
    47         call->priv = (sysarg_t) phone_obj;
     45        errno_t rc = phone_alloc(TASK, &phone_handle);
    4846        IPC_SET_ARG5(call->data, (rc == EOK) ? phone_handle : -1);
    4947        return 0;
     
    5351{
    5452        cap_handle_t phone_handle = (cap_handle_t) IPC_GET_ARG5(*olddata);
    55         kobject_t *phone_obj = (kobject_t *) answer->priv;
    5653
    57         if (phone_handle >= 0) {
    58                 kobject_put(phone_obj);
    59                 cap_free(TASK, phone_handle);
    60         }
     54        if (phone_handle >= 0)
     55                phone_dealloc(phone_handle);
    6156
    6257        return EOK;
     
    6661{
    6762        cap_handle_t phone_handle = (cap_handle_t) IPC_GET_ARG5(*olddata);
    68         kobject_t *phone_obj = (kobject_t *) answer->priv;
    6963
    7064        if (IPC_GET_RETVAL(answer->data) != EOK) {
     
    7266                answer_cleanup(answer, olddata);
    7367        } else if (phone_handle >= 0) {
    74                 /*
    75                  * The connection was accepted
    76                  */
    77 
    78                 /*
    79                  * We need to create another reference as the one we have now
    80                  * will be consumed by ipc_phone_connect().
    81                  */
    82                 kobject_add_ref(phone_obj);
    83 
    84                 if (ipc_phone_connect(phone_obj->phone,
    85                     &answer->sender->answerbox)) {
    86                         /* Pass the reference to the capability */
    87                         cap_publish(TASK, phone_handle, phone_obj);
     68                /* The connection was accepted */
     69                if (phone_connect(phone_handle, &answer->sender->answerbox)) {
    8870                        /* Set 'phone hash' as ARG5 of response */
     71                        kobject_t *phone_obj = kobject_get(TASK, phone_handle,
     72                            KOBJECT_TYPE_PHONE);
    8973                        IPC_SET_ARG5(answer->data,
    9074                            (sysarg_t) phone_obj->phone);
     75                        kobject_put(phone_obj);
    9176                } else {
    9277                        /* The answerbox is shutting down. */
Note: See TracChangeset for help on using the changeset viewer.