Changes in uspace/lib/libc/generic/ipc.c [d9c8c81:ba8f8cb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/ipc.c
rd9c8c81 rba8f8cb 565 565 } 566 566 567 /** Interrupt one thread of this task from waiting for IPC. */ 568 void ipc_poke(void) 569 { 570 __SYSCALL0(SYS_IPC_POKE); 571 } 572 567 573 /** Ask destination to do a callback connection. 568 574 * … … 724 730 int res; 725 731 sysarg_t tmp_flags; 726 res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst,732 res = ipc_call_sync_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst, 727 733 (ipcarg_t) size, arg, NULL, &tmp_flags); 728 734 if (flags) … … 731 737 } 732 738 733 /** Wrapper for receiving the IPC_M_SHARE_IN calls.734 *735 * This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN calls736 * so that the user doesn't have to remember the meaning of each IPC argument.737 *738 * So far, this wrapper is to be used from within a connection fibril.739 *740 * @param callid Storage where the hash of the IPC_M_SHARE_IN call will741 * be stored.742 * @param size Destination address space area size.743 *744 * @return Non-zero on success, zero on failure.745 */746 int ipc_share_in_receive(ipc_callid_t *callid, size_t *size)747 {748 ipc_call_t data;749 750 assert(callid);751 assert(size);752 753 *callid = async_get_call(&data);754 if (IPC_GET_METHOD(data) != IPC_M_SHARE_IN)755 return 0;756 *size = (size_t) IPC_GET_ARG2(data);757 return 1;758 }759 760 739 /** Wrapper for answering the IPC_M_SHARE_IN calls. 761 740 * … … 784 763 int ipc_share_out_start(int phoneid, void *src, int flags) 785 764 { 786 return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0,765 return ipc_call_sync_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0, 787 766 (ipcarg_t) flags); 788 }789 790 /** Wrapper for receiving the IPC_M_SHARE_OUT calls.791 *792 * This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT calls793 * so that the user doesn't have to remember the meaning of each IPC argument.794 *795 * So far, this wrapper is to be used from within a connection fibril.796 *797 * @param callid Storage where the hash of the IPC_M_SHARE_OUT call will798 * be stored.799 * @param size Storage where the source address space area size will be800 * stored.801 * @param flags Storage where the sharing flags will be stored.802 *803 * @return Non-zero on success, zero on failure.804 */805 int ipc_share_out_receive(ipc_callid_t *callid, size_t *size, int *flags)806 {807 ipc_call_t data;808 809 assert(callid);810 assert(size);811 assert(flags);812 813 *callid = async_get_call(&data);814 if (IPC_GET_METHOD(data) != IPC_M_SHARE_OUT)815 return 0;816 *size = (size_t) IPC_GET_ARG2(data);817 *flags = (int) IPC_GET_ARG3(data);818 return 1;819 767 } 820 768 … … 845 793 int ipc_data_read_start(int phoneid, void *dst, size_t size) 846 794 { 847 return async_req_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst,795 return ipc_call_sync_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst, 848 796 (ipcarg_t) size); 849 }850 851 /** Wrapper for receiving the IPC_M_DATA_READ calls.852 *853 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ calls854 * so that the user doesn't have to remember the meaning of each IPC argument.855 *856 * So far, this wrapper is to be used from within a connection fibril.857 *858 * @param callid Storage where the hash of the IPC_M_DATA_READ call will859 * be stored.860 * @param size Storage where the maximum size will be stored. Can be861 * NULL.862 *863 * @return Non-zero on success, zero on failure.864 */865 int ipc_data_read_receive(ipc_callid_t *callid, size_t *size)866 {867 ipc_call_t data;868 869 assert(callid);870 871 *callid = async_get_call(&data);872 if (IPC_GET_METHOD(data) != IPC_M_DATA_READ)873 return 0;874 if (size)875 *size = (size_t) IPC_GET_ARG2(data);876 return 1;877 797 } 878 798 … … 904 824 int ipc_data_write_start(int phoneid, const void *src, size_t size) 905 825 { 906 return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,826 return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src, 907 827 (ipcarg_t) size); 908 }909 910 /** Wrapper for receiving the IPC_M_DATA_WRITE calls.911 *912 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE calls913 * so that the user doesn't have to remember the meaning of each IPC argument.914 *915 * So far, this wrapper is to be used from within a connection fibril.916 *917 * @param callid Storage where the hash of the IPC_M_DATA_WRITE call will918 * be stored.919 * @param size Storage where the suggested size will be stored. May be920 * NULL921 *922 * @return Non-zero on success, zero on failure.923 */924 int ipc_data_write_receive(ipc_callid_t *callid, size_t *size)925 {926 ipc_call_t data;927 928 assert(callid);929 930 *callid = async_get_call(&data);931 if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE)932 return 0;933 if (size)934 *size = (size_t) IPC_GET_ARG2(data);935 return 1;936 828 } 937 829
Note:
See TracChangeset
for help on using the changeset viewer.