Changes in uspace/lib/libc/generic/ipc.c [ba8f8cb:057d21a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/ipc.c
rba8f8cb r057d21a 730 730 int res; 731 731 sysarg_t tmp_flags; 732 res = ipc_call_sync_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst,732 res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst, 733 733 (ipcarg_t) size, arg, NULL, &tmp_flags); 734 734 if (flags) … … 737 737 } 738 738 739 /** Wrapper for receiving the IPC_M_SHARE_IN calls. 740 * 741 * This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN calls 742 * so that the user doesn't have to remember the meaning of each IPC argument. 743 * 744 * So far, this wrapper is to be used from within a connection fibril. 745 * 746 * @param callid Storage where the hash of the IPC_M_SHARE_IN call will 747 * be stored. 748 * @param size Destination address space area size. 749 * 750 * @return Non-zero on success, zero on failure. 751 */ 752 int ipc_share_in_receive(ipc_callid_t *callid, size_t *size) 753 { 754 ipc_call_t data; 755 756 assert(callid); 757 assert(size); 758 759 *callid = async_get_call(&data); 760 if (IPC_GET_METHOD(data) != IPC_M_SHARE_IN) 761 return 0; 762 *size = (size_t) IPC_GET_ARG2(data); 763 return 1; 764 } 765 739 766 /** Wrapper for answering the IPC_M_SHARE_IN calls. 740 767 * … … 763 790 int ipc_share_out_start(int phoneid, void *src, int flags) 764 791 { 765 return ipc_call_sync_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0,792 return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0, 766 793 (ipcarg_t) flags); 794 } 795 796 /** Wrapper for receiving the IPC_M_SHARE_OUT calls. 797 * 798 * This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT calls 799 * so that the user doesn't have to remember the meaning of each IPC argument. 800 * 801 * So far, this wrapper is to be used from within a connection fibril. 802 * 803 * @param callid Storage where the hash of the IPC_M_SHARE_OUT call will 804 * be stored. 805 * @param size Storage where the source address space area size will be 806 * stored. 807 * @param flags Storage where the sharing flags will be stored. 808 * 809 * @return Non-zero on success, zero on failure. 810 */ 811 int ipc_share_out_receive(ipc_callid_t *callid, size_t *size, int *flags) 812 { 813 ipc_call_t data; 814 815 assert(callid); 816 assert(size); 817 assert(flags); 818 819 *callid = async_get_call(&data); 820 if (IPC_GET_METHOD(data) != IPC_M_SHARE_OUT) 821 return 0; 822 *size = (size_t) IPC_GET_ARG2(data); 823 *flags = (int) IPC_GET_ARG3(data); 824 return 1; 767 825 } 768 826 … … 793 851 int ipc_data_read_start(int phoneid, void *dst, size_t size) 794 852 { 795 return ipc_call_sync_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst,853 return async_req_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst, 796 854 (ipcarg_t) size); 855 } 856 857 /** Wrapper for receiving the IPC_M_DATA_READ calls. 858 * 859 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ calls 860 * so that the user doesn't have to remember the meaning of each IPC argument. 861 * 862 * So far, this wrapper is to be used from within a connection fibril. 863 * 864 * @param callid Storage where the hash of the IPC_M_DATA_READ call will 865 * be stored. 866 * @param size Storage where the maximum size will be stored. Can be 867 * NULL. 868 * 869 * @return Non-zero on success, zero on failure. 870 */ 871 int ipc_data_read_receive(ipc_callid_t *callid, size_t *size) 872 { 873 ipc_call_t data; 874 875 assert(callid); 876 877 *callid = async_get_call(&data); 878 if (IPC_GET_METHOD(data) != IPC_M_DATA_READ) 879 return 0; 880 if (size) 881 *size = (size_t) IPC_GET_ARG2(data); 882 return 1; 797 883 } 798 884 … … 824 910 int ipc_data_write_start(int phoneid, const void *src, size_t size) 825 911 { 826 return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,912 return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src, 827 913 (ipcarg_t) size); 914 } 915 916 /** Wrapper for receiving the IPC_M_DATA_WRITE calls. 917 * 918 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE calls 919 * so that the user doesn't have to remember the meaning of each IPC argument. 920 * 921 * So far, this wrapper is to be used from within a connection fibril. 922 * 923 * @param callid Storage where the hash of the IPC_M_DATA_WRITE call will 924 * be stored. 925 * @param size Storage where the suggested size will be stored. May be 926 * NULL 927 * 928 * @return Non-zero on success, zero on failure. 929 */ 930 int ipc_data_write_receive(ipc_callid_t *callid, size_t *size) 931 { 932 ipc_call_t data; 933 934 assert(callid); 935 936 *callid = async_get_call(&data); 937 if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE) 938 return 0; 939 if (size) 940 *size = (size_t) IPC_GET_ARG2(data); 941 return 1; 828 942 } 829 943
Note:
See TracChangeset
for help on using the changeset viewer.