Changeset ba8f8cb in mainline
- Timestamp:
- 2009-10-11T16:20:24Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- db4d6de, f307f12
- Parents:
- 0da4e41
- Location:
- uspace/lib/libc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/ipc.c
r0da4e41 rba8f8cb 730 730 int res; 731 731 sysarg_t tmp_flags; 732 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, 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 calls742 * 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 will747 * 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 766 739 /** Wrapper for answering the IPC_M_SHARE_IN calls. 767 740 * … … 790 763 int ipc_share_out_start(int phoneid, void *src, int flags) 791 764 { 792 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, 793 766 (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 calls799 * 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 will804 * be stored.805 * @param size Storage where the source address space area size will be806 * 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;825 767 } 826 768 … … 851 793 int ipc_data_read_start(int phoneid, void *dst, size_t size) 852 794 { 853 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, 854 796 (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 calls860 * 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 will865 * be stored.866 * @param size Storage where the maximum size will be stored. Can be867 * 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;883 797 } 884 798 … … 910 824 int ipc_data_write_start(int phoneid, const void *src, size_t size) 911 825 { 912 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, 913 827 (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 calls919 * 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 will924 * be stored.925 * @param size Storage where the suggested size will be stored. May be926 * NULL927 *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;942 828 } 943 829 -
uspace/lib/libc/include/ipc/ipc.h
r0da4e41 rba8f8cb 283 283 284 284 extern int ipc_share_in_start(int, void *, size_t, ipcarg_t, int *); 285 extern int ipc_share_in_receive(ipc_callid_t *, size_t *);286 285 extern int ipc_share_in_finalize(ipc_callid_t, void *, int ); 287 286 extern int ipc_share_out_start(int, void *, int); 288 extern int ipc_share_out_receive(ipc_callid_t *, size_t *, int *);289 287 extern int ipc_share_out_finalize(ipc_callid_t, void *); 290 288 extern int ipc_data_read_start(int, void *, size_t); 291 extern int ipc_data_read_receive(ipc_callid_t *, size_t *);292 289 extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t); 293 290 extern int ipc_data_write_start(int, const void *, size_t); 294 extern int ipc_data_write_receive(ipc_callid_t *, size_t *);295 291 extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t); 296 292
Note:
See TracChangeset
for help on using the changeset viewer.