Rev 2530 | Rev 2568 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2530 | Rev 2531 | ||
|---|---|---|---|
| Line 513... | Line 513... | ||
| 513 | * |
513 | * |
| 514 | * @return Zero on success or a negative error code. |
514 | * @return Zero on success or a negative error code. |
| 515 | */ |
515 | */ |
| 516 | int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phonehash) |
516 | int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phonehash) |
| 517 | { |
517 | { |
| 518 | return ipc_call_sync_3(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2, 0, 0, 0, |
518 | return ipc_call_sync_3(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2, 0, 0, |
| 519 | phonehash); |
519 | 0, phonehash); |
| 520 | } |
520 | } |
| 521 | 521 | ||
| 522 | /** Ask through phone for a new connection to some service. |
522 | /** Ask through phone for a new connection to some service. |
| 523 | * |
523 | * |
| 524 | * @param phoneid Phone handle used for contacting the other side. |
524 | * @param phoneid Phone handle used for contacting the other side. |
| Line 530... | Line 530... | ||
| 530 | int ipc_connect_me_to(int phoneid, int arg1, int arg2) |
530 | int ipc_connect_me_to(int phoneid, int arg1, int arg2) |
| 531 | { |
531 | { |
| 532 | ipcarg_t newphid; |
532 | ipcarg_t newphid; |
| 533 | int res; |
533 | int res; |
| 534 | 534 | ||
| 535 | res = ipc_call_sync_3(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, 0, 0, 0, |
535 | res = ipc_call_sync_3(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, 0, 0, 0, |
| 536 | &newphid); |
536 | &newphid); |
| 537 | if (res) |
537 | if (res) |
| 538 | return res; |
538 | return res; |
| 539 | return newphid; |
539 | return newphid; |
| 540 | } |
540 | } |
| Line 593... | Line 593... | ||
| 593 | int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method, ipcarg_t arg1) |
593 | int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method, ipcarg_t arg1) |
| 594 | { |
594 | { |
| 595 | return __SYSCALL4(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1); |
595 | return __SYSCALL4(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1); |
| 596 | } |
596 | } |
| 597 | 597 | ||
| 598 | /** Wrapper for accepting the IPC_M_DATA_SEND calls. |
598 | /** Wrapper for making IPC_M_DATA_SEND calls. |
| 599 | * |
599 | * |
| - | 600 | * @param phoneid Phone that will be used to contact the receiving side. |
|
| - | 601 | * @param src Address of the beginning of the source buffer. |
|
| - | 602 | * @param size Size of the source buffer. |
|
| - | 603 | * |
|
| - | 604 | * @return Zero on success or a negative error code from errno.h. |
|
| - | 605 | */ |
|
| - | 606 | int ipc_data_send(int phoneid, void *src, size_t size) |
|
| - | 607 | { |
|
| - | 608 | return ipc_call_sync_3(phoneid, IPC_M_DATA_SEND, 0, (ipcarg_t) src, |
|
| - | 609 | (ipcarg_t) size, NULL, NULL, NULL); |
|
| - | 610 | } |
|
| - | 611 | ||
| - | 612 | /** Wrapper for receiving the IPC_M_DATA_SEND calls. |
|
| - | 613 | * |
|
| 600 | * This wrapper only makes it more comfortable to accept IPC_M_DATA_SEND calls |
614 | * This wrapper only makes it more comfortable to receive IPC_M_DATA_SEND calls |
| 601 | * so that the user doesn't have to remember the meaning of each IPC argument. |
615 | * so that the user doesn't have to remember the meaning of each IPC argument. |
| 602 | * |
616 | * |
| 603 | * So far, this wrapper is to be used from within a connection fibril. |
617 | * So far, this wrapper is to be used from within a connection fibril. |
| 604 | * |
618 | * |
| 605 | * @param callid Storage where the hash of the IPC_M_DATA_SEND call will |
619 | * @param callid Storage where the hash of the IPC_M_DATA_SEND call will |
| Line 610... | Line 624... | ||
| 610 | * @param size Storage where the suggested size will be stored. May be |
624 | * @param size Storage where the suggested size will be stored. May be |
| 611 | * NULL |
625 | * NULL |
| 612 | * |
626 | * |
| 613 | * @return Non-zero on success, zero on failure. |
627 | * @return Non-zero on success, zero on failure. |
| 614 | */ |
628 | */ |
| 615 | int ipc_data_send_accept(ipc_callid_t *callid, ipc_call_t *call, void **dst, |
629 | int ipc_data_receive(ipc_callid_t *callid, ipc_call_t *call, void **dst, |
| 616 | size_t *size) |
630 | size_t *size) |
| 617 | { |
631 | { |
| 618 | assert(callid); |
632 | assert(callid); |
| 619 | assert(call); |
633 | assert(call); |
| 620 | 634 | ||
| Line 638... | Line 652... | ||
| 638 | * @param dst Final destination address for the IPC_M_DATA_SEND call. |
652 | * @param dst Final destination address for the IPC_M_DATA_SEND call. |
| 639 | * @param size Final size for the IPC_M_DATA_SEND call. |
653 | * @param size Final size for the IPC_M_DATA_SEND call. |
| 640 | * |
654 | * |
| 641 | * @return Zero on success or a value from @ref errno.h on failure. |
655 | * @return Zero on success or a value from @ref errno.h on failure. |
| 642 | */ |
656 | */ |
| 643 | ipcarg_t ipc_data_send_answer(ipc_callid_t callid, ipc_call_t *call, void *dst, size_t size) |
657 | ipcarg_t ipc_data_deliver(ipc_callid_t callid, ipc_call_t *call, void *dst, |
| - | 658 | size_t size) |
|
| 644 | { |
659 | { |
| 645 | IPC_SET_RETVAL(*call, EOK); |
660 | IPC_SET_RETVAL(*call, EOK); |
| 646 | IPC_SET_ARG1(*call, (ipcarg_t) dst); |
661 | IPC_SET_ARG1(*call, (ipcarg_t) dst); |
| 647 | IPC_SET_ARG3(*call, (ipcarg_t) size); |
662 | IPC_SET_ARG3(*call, (ipcarg_t) size); |
| 648 | return ipc_answer(callid, call); |
663 | return ipc_answer(callid, call); |