Rev 2490 | Rev 2530 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2490 | Rev 2522 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | #include <unistd.h> |
48 | #include <unistd.h> |
49 | #include <futex.h> |
49 | #include <futex.h> |
50 | #include <kernel/synch/synch.h> |
50 | #include <kernel/synch/synch.h> |
51 | #include <async.h> |
51 | #include <async.h> |
52 | #include <fibril.h> |
52 | #include <fibril.h> |
- | 53 | #include <assert.h> |
|
53 | 54 | ||
54 | /** |
55 | /** |
55 | * Structures of this type are used for keeping track of sent asynchronous calls |
56 | * Structures of this type are used for keeping track of sent asynchronous calls |
56 | * and queing unsent calls. |
57 | * and queing unsent calls. |
57 | */ |
58 | */ |
Line 592... | Line 593... | ||
592 | 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) |
593 | { |
594 | { |
594 | return __SYSCALL4(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1); |
595 | return __SYSCALL4(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1); |
595 | } |
596 | } |
596 | 597 | ||
- | 598 | /** Wrapper for accepting the IPC_M_DATA_SEND calls. |
|
- | 599 | * |
|
- | 600 | * This wrapper only makes it more comfortable to accept IPC_M_DATA_SEND calls |
|
- | 601 | * so that the user doesn't have to remember the meaning of each IPC argument. |
|
- | 602 | * |
|
- | 603 | * So far, this wrapper is to be used from within a connection fibril. |
|
- | 604 | * |
|
- | 605 | * @param callid Storage where the hash of the IPC_M_DATA_SEND call will |
|
- | 606 | * be stored. |
|
- | 607 | * @param call Storage where the incoming call will be stored. |
|
- | 608 | * @param dst Storage where the suggested destination address will |
|
- | 609 | * be stored. May be NULL. |
|
- | 610 | * @param size Storage where the suggested size will be stored. May be |
|
- | 611 | * NULL |
|
- | 612 | * |
|
- | 613 | * @return Non-zero on success, zero on failure. |
|
- | 614 | */ |
|
- | 615 | int ipc_data_send_accept(ipc_callid_t *callid, ipc_call_t *call, void **dst, |
|
- | 616 | size_t *size) |
|
- | 617 | { |
|
- | 618 | assert(callid); |
|
- | 619 | assert(call); |
|
- | 620 | ||
- | 621 | *callid = async_get_call(call); |
|
- | 622 | if (IPC_GET_METHOD(*call) != IPC_M_DATA_SEND) |
|
- | 623 | return 0; |
|
- | 624 | if (dst) |
|
- | 625 | *dst = (void *) IPC_GET_ARG1(*call); |
|
- | 626 | if (size) |
|
- | 627 | *size = (size_t) IPC_GET_ARG3(*call); |
|
- | 628 | return 1; |
|
- | 629 | } |
|
- | 630 | ||
- | 631 | /** Wrapper for answering the IPC_M_DATA_SEND calls. |
|
- | 632 | * |
|
- | 633 | * This wrapper only makes it more comfortable to answer IPC_M_DATA_SEND calls |
|
- | 634 | * so that the user doesn't have to remember the meaning of each IPC argument. |
|
- | 635 | * |
|
- | 636 | * @param callid Hash of the IPC_M_DATA_SEND call to answer. |
|
- | 637 | * @param call Call structure with the request. |
|
- | 638 | * @param dst Final destination address for the IPC_M_DATA_SEND call. |
|
- | 639 | * @param size Final size for the IPC_M_DATA_SEND call. |
|
- | 640 | * |
|
- | 641 | * @return Zero on success or a value from @ref errno.h on failure. |
|
- | 642 | */ |
|
- | 643 | ipcarg_t ipc_data_send_answer(ipc_callid_t callid, ipc_call_t *call, void *dst, size_t size) |
|
- | 644 | { |
|
- | 645 | IPC_SET_RETVAL(*call, EOK); |
|
- | 646 | IPC_SET_ARG1(*call, (ipcarg_t) dst); |
|
- | 647 | IPC_SET_ARG3(*call, (ipcarg_t) size); |
|
- | 648 | return ipc_answer(callid, call); |
|
- | 649 | } |
|
- | 650 | ||
597 | /** @} |
651 | /** @} |
598 | */ |
652 | */ |