Subversion Repositories HelenOS

Rev

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

Rev 3386 Rev 4153
Line 596... Line 596...
596
int ipc_connect_me_to(int phoneid, int arg1, int arg2, int arg3)
596
int ipc_connect_me_to(int phoneid, int arg1, int arg2, int arg3)
597
{
597
{
598
    ipcarg_t newphid;
598
    ipcarg_t newphid;
599
    int res;
599
    int res;
600
 
600
 
601
    res = ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
601
    res = ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
602
        NULL, NULL, NULL, NULL, &newphid);
602
        NULL, NULL, NULL, NULL, &newphid);
603
    if (res)
603
    if (res)
604
        return res;
604
        return res;
605
    return newphid;
605
    return newphid;
606
}
606
}
607
 
607
 
-
 
608
/** Ask through phone for a new connection to some service.
-
 
609
 *
-
 
610
 * If the connection is not available at the moment, the
-
 
611
 * call will block.
-
 
612
 *
-
 
613
 * @param phoneid   Phone handle used for contacting the other side.
-
 
614
 * @param arg1      User defined argument.
-
 
615
 * @param arg2      User defined argument.
-
 
616
 * @param arg3      User defined argument.
-
 
617
 *
-
 
618
 * @return      New phone handle on success or a negative error code.
-
 
619
 */
-
 
620
int ipc_connect_me_to_blocking(int phoneid, int arg1, int arg2, int arg3)
-
 
621
{
-
 
622
    ipcarg_t newphid;
-
 
623
    int res;
-
 
624
 
-
 
625
    res = ipc_call_sync_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
-
 
626
        IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid);
-
 
627
    if (res)
-
 
628
        return res;
-
 
629
    return newphid;
-
 
630
}
-
 
631
 
608
/** Hang up a phone.
632
/** Hang up a phone.
609
 *
633
 *
610
 * @param phoneid   Handle of the phone to be hung up.
634
 * @param phoneid   Handle of the phone to be hung up.
611
 *
635
 *
612
 * @return      Zero on success or a negative error code.
636
 * @return      Zero on success or a negative error code.
Line 664... Line 688...
664
{
688
{
665
    return __SYSCALL6(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1,
689
    return __SYSCALL6(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1,
666
        arg2, mode);
690
        arg2, mode);
667
}
691
}
668
 
692
 
-
 
693
 
-
 
694
int ipc_forward_slow(ipc_callid_t callid, int phoneid, int method,
-
 
695
    ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
-
 
696
    int mode)
-
 
697
{
-
 
698
    ipc_call_t data;
-
 
699
 
-
 
700
    IPC_SET_METHOD(data, method);
-
 
701
    IPC_SET_ARG1(data, arg1);
-
 
702
    IPC_SET_ARG2(data, arg2);
-
 
703
    IPC_SET_ARG3(data, arg3);
-
 
704
    IPC_SET_ARG4(data, arg4);
-
 
705
    IPC_SET_ARG5(data, arg5);
-
 
706
 
-
 
707
    return __SYSCALL3(SYS_IPC_FORWARD_SLOW, callid, (sysarg_t) &data, mode);
-
 
708
}
-
 
709
 
669
/** Wrapper for making IPC_M_SHARE_IN calls.
710
/** Wrapper for making IPC_M_SHARE_IN calls.
670
 *
711
 *
671
 * @param phoneid   Phone that will be used to contact the receiving side.
712
 * @param phoneid   Phone that will be used to contact the receiving side.
672
 * @param dst       Destination address space area base.
713
 * @param dst       Destination address space area base.
673
 * @param size      Size of the destination address space area.
714
 * @param size      Size of the destination address space area.
Line 845... Line 886...
845
 * @param size      Size for the IPC_M_DATA_READ call. Can be smaller than
886
 * @param size      Size for the IPC_M_DATA_READ call. Can be smaller than
846
 *          the maximum size announced by the sender.
887
 *          the maximum size announced by the sender.
847
 *
888
 *
848
 * @return      Zero on success or a value from @ref errno.h on failure.
889
 * @return      Zero on success or a value from @ref errno.h on failure.
849
 */
890
 */
850
int ipc_data_read_finalize(ipc_callid_t callid, void *src, size_t size)
891
int ipc_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
851
{
892
{
852
    return ipc_answer_2(callid, EOK, (ipcarg_t) src, (ipcarg_t) size);
893
    return ipc_answer_2(callid, EOK, (ipcarg_t) src, (ipcarg_t) size);
853
}
894
}
854
 
895
 
855
/** Wrapper for making IPC_M_DATA_WRITE calls.
896
/** Wrapper for making IPC_M_DATA_WRITE calls.
Line 858... Line 899...
858
 * @param src       Address of the beginning of the source buffer.
899
 * @param src       Address of the beginning of the source buffer.
859
 * @param size      Size of the source buffer.
900
 * @param size      Size of the source buffer.
860
 *
901
 *
861
 * @return      Zero on success or a negative error code from errno.h.
902
 * @return      Zero on success or a negative error code from errno.h.
862
 */
903
 */
863
int ipc_data_write_start(int phoneid, void *src, size_t size)
904
int ipc_data_write_start(int phoneid, const void *src, size_t size)
864
{
905
{
865
    return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,
906
    return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,
866
        (ipcarg_t) size);
907
        (ipcarg_t) size);
867
}
908
}
868
 
909
 
Line 907... Line 948...
907
 */
948
 */
908
int ipc_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
949
int ipc_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
909
{
950
{
910
    return ipc_answer_2(callid, EOK, (ipcarg_t) dst, (ipcarg_t) size);
951
    return ipc_answer_2(callid, EOK, (ipcarg_t) dst, (ipcarg_t) size);
911
}
952
}
-
 
953
 
-
 
954
#include <kernel/syscall/sysarg64.h>
-
 
955
/** Connect to a task specified by id.
-
 
956
 */
-
 
957
int ipc_connect_kbox(task_id_t id)
-
 
958
{
-
 
959
    sysarg64_t arg;
-
 
960
 
-
 
961
    arg.value = (unsigned long long) id;
-
 
962
 
-
 
963
    return __SYSCALL1(SYS_IPC_CONNECT_KBOX, (sysarg_t) &arg);
-
 
964
}
912
 
965
 
913
/** @}
966
/** @}
914
 */
967
 */