Subversion Repositories HelenOS

Rev

Rev 2663 | Rev 2677 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2663 Rev 2676
Line 733... Line 733...
733
 *
733
 *
734
 * @return      Zero on success or a negative error code from errno.h.
734
 * @return      Zero on success or a negative error code from errno.h.
735
 */
735
 */
736
int ipc_data_write_send(int phoneid, void *src, size_t size)
736
int ipc_data_write_send(int phoneid, void *src, size_t size)
737
{
737
{
738
    return ipc_call_sync_3_0(phoneid, IPC_M_DATA_WRITE, 0, (ipcarg_t) src,
738
    return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,
739
        (ipcarg_t) size);
739
        (ipcarg_t) size);
740
}
740
}
741
 
741
 
742
/** Wrapper for receiving the IPC_M_DATA_WRITE calls.
742
/** Wrapper for receiving the IPC_M_DATA_WRITE calls.
743
 *
743
 *
Line 746... Line 746...
746
 *
746
 *
747
 * So far, this wrapper is to be used from within a connection fibril.
747
 * So far, this wrapper is to be used from within a connection fibril.
748
 *
748
 *
749
 * @param callid    Storage where the hash of the IPC_M_DATA_WRITE call will
749
 * @param callid    Storage where the hash of the IPC_M_DATA_WRITE call will
750
 *          be stored.
750
 *          be stored.
751
 * @param dst       Storage where the suggested destination address will
-
 
752
 *          be stored. May be NULL.
-
 
753
 * @param size      Storage where the suggested size will be stored. May be
751
 * @param size      Storage where the suggested size will be stored. May be
754
 *          NULL
752
 *          NULL
755
 *
753
 *
756
 * @return      Non-zero on success, zero on failure.
754
 * @return      Non-zero on success, zero on failure.
757
 */
755
 */
758
int ipc_data_write_receive(ipc_callid_t *callid, void **dst, size_t *size)
756
int ipc_data_write_receive(ipc_callid_t *callid, size_t *size)
759
{
757
{
760
    ipc_call_t data;
758
    ipc_call_t data;
761
   
759
   
762
    assert(callid);
760
    assert(callid);
763
 
761
 
764
    *callid = async_get_call(&data);
762
    *callid = async_get_call(&data);
765
    if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE)
763
    if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE)
766
        return 0;
764
        return 0;
767
    if (dst)
-
 
768
        *dst = (void *) IPC_GET_ARG1(data);
-
 
769
    if (size)
765
    if (size)
770
        *size = (size_t) IPC_GET_ARG3(data);
766
        *size = (size_t) IPC_GET_ARG2(data);
771
    return 1;
767
    return 1;
772
}
768
}
773
 
769
 
774
/** Wrapper for answering the IPC_M_DATA_WRITE calls.
770
/** Wrapper for answering the IPC_M_DATA_WRITE calls.
775
 *
771
 *
Line 782... Line 778...
782
 *
778
 *
783
 * @return      Zero on success or a value from @ref errno.h on failure.
779
 * @return      Zero on success or a value from @ref errno.h on failure.
784
 */
780
 */
785
int ipc_data_write_deliver(ipc_callid_t callid, void *dst, size_t size)
781
int ipc_data_write_deliver(ipc_callid_t callid, void *dst, size_t size)
786
{
782
{
787
    return ipc_answer_3(callid, EOK, (ipcarg_t) dst, 0, (ipcarg_t) size);
783
    return ipc_answer_2(callid, EOK, (ipcarg_t) dst, (ipcarg_t) size);
788
}
784
}
789
 
785
 
790
/** @}
786
/** @}
791
 */
787
 */