Changes in kernel/generic/src/ipc/ipc.c [b7fd2a0:82d515e9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rb7fd2a0 r82d515e9 205 205 * @param request Call structure with request. 206 206 * 207 * @return EOK on success or a nerror 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 */ 210 int ipc_call_sync(phone_t *phone, call_t *request) 211 211 { 212 212 answerbox_t *mybox = slab_alloc(answerbox_cache, 0); … … 216 216 request->callerbox = mybox; 217 217 218 errno_t rc = ipc_call(phone, request);218 int rc = ipc_call(phone, request); 219 219 if (rc != EOK) { 220 220 slab_free(answerbox_cache, mybox); … … 371 371 * 372 372 */ 373 void ipc_backsend_err(phone_t *phone, call_t *call, errno_t err)373 void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err) 374 374 { 375 375 _ipc_call_actions_internal(phone, call, false); … … 415 415 * 416 416 */ 417 errno_t ipc_call(phone_t *phone, call_t *call)417 int ipc_call(phone_t *phone, call_t *call) 418 418 { 419 419 mutex_lock(&phone->lock); … … 444 444 * @param phone Phone structure to be hung up. 445 445 * 446 * @return EOKif the phone is disconnected.447 * @return EINVALif 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 */ 450 int ipc_phone_hangup(phone_t *phone) 451 451 { 452 452 mutex_lock(&phone->lock); … … 455 455 phone->state == IPC_PHONE_CONNECTING) { 456 456 mutex_unlock(&phone->lock); 457 return EINVAL;457 return -1; 458 458 } 459 459 … … 478 478 mutex_unlock(&phone->lock); 479 479 480 return EOK;480 return 0; 481 481 } 482 482 … … 495 495 * 496 496 */ 497 errno_t ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox,497 int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox, 498 498 unsigned int mode) 499 499 { … … 535 535 uint64_t answer_cnt = 0; 536 536 uint64_t call_cnt = 0; 537 errno_t rc;537 int rc; 538 538 539 539 restart: 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)) 542 542 return NULL; 543 543 … … 638 638 phone = list_get_instance(list_first(&box->connected_phones), 639 639 phone_t, link); 640 if ( mutex_trylock(&phone->lock) != EOK) {640 if (SYNCH_FAILED(mutex_trylock(&phone->lock))) { 641 641 irq_spinlock_unlock(&box->lock, true); 642 642 DEADLOCK_PROBE(p_phonelck, DEADLOCK_THRESHOLD);
Note:
See TracChangeset
for help on using the changeset viewer.