Ignore:
File:
1 edited

Legend:

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

    rb7fd2a0 r82d515e9  
    205205 * @param request Call structure with request.
    206206 *
    207  * @return EOK on success or an error code.
    208  *
    209  */
    210 errno_t ipc_call_sync(phone_t *phone, call_t *request)
     207 * @return EOK on success or a negative error code.
     208 *
     209 */
     210int ipc_call_sync(phone_t *phone, call_t *request)
    211211{
    212212        answerbox_t *mybox = slab_alloc(answerbox_cache, 0);
     
    216216        request->callerbox = mybox;
    217217       
    218         errno_t rc = ipc_call(phone, request);
     218        int rc = ipc_call(phone, request);
    219219        if (rc != EOK) {
    220220                slab_free(answerbox_cache, mybox);
     
    371371 *
    372372 */
    373 void ipc_backsend_err(phone_t *phone, call_t *call, errno_t err)
     373void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
    374374{
    375375        _ipc_call_actions_internal(phone, call, false);
     
    415415 *
    416416 */
    417 errno_t ipc_call(phone_t *phone, call_t *call)
     417int ipc_call(phone_t *phone, call_t *call)
    418418{
    419419        mutex_lock(&phone->lock);
     
    444444 * @param phone Phone structure to be hung up.
    445445 *
    446  * @return EOK if the phone is disconnected.
    447  * @return EINVAL if the phone was already disconnected.
    448  *
    449  */
    450 errno_t ipc_phone_hangup(phone_t *phone)
     446 * @return 0 if the phone is disconnected.
     447 * @return -1 if the phone was already disconnected.
     448 *
     449 */
     450int ipc_phone_hangup(phone_t *phone)
    451451{
    452452        mutex_lock(&phone->lock);
     
    455455            phone->state == IPC_PHONE_CONNECTING) {
    456456                mutex_unlock(&phone->lock);
    457                 return EINVAL;
     457                return -1;
    458458        }
    459459       
     
    478478        mutex_unlock(&phone->lock);
    479479       
    480         return EOK;
     480        return 0;
    481481}
    482482
     
    495495 *
    496496 */
    497 errno_t ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox,
     497int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox,
    498498    unsigned int mode)
    499499{
     
    535535        uint64_t answer_cnt = 0;
    536536        uint64_t call_cnt = 0;
    537         errno_t rc;
     537        int rc;
    538538       
    539539restart:
    540         rc = waitq_sleep_timeout(&box->wq, usec, flags, NULL);
    541         if (rc != EOK)
     540        rc = waitq_sleep_timeout(&box->wq, usec, flags);
     541        if (SYNCH_FAILED(rc))
    542542                return NULL;
    543543       
     
    638638                phone = list_get_instance(list_first(&box->connected_phones),
    639639                    phone_t, link);
    640                 if (mutex_trylock(&phone->lock) != EOK) {
     640                if (SYNCH_FAILED(mutex_trylock(&phone->lock))) {
    641641                        irq_spinlock_unlock(&box->lock, true);
    642642                        DEADLOCK_PROBE(p_phonelck, DEADLOCK_THRESHOLD);
Note: See TracChangeset for help on using the changeset viewer.