Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/ipc.c

    rd9c8c81 rba8f8cb  
    565565}
    566566
     567/** Interrupt one thread of this task from waiting for IPC. */
     568void ipc_poke(void)
     569{
     570        __SYSCALL0(SYS_IPC_POKE);
     571}
     572
    567573/** Ask destination to do a callback connection.
    568574 *
     
    724730        int res;
    725731        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,
    727733            (ipcarg_t) size, arg, NULL, &tmp_flags);
    728734        if (flags)
     
    731737}
    732738
    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 calls
    736  * 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 will
    741  *                      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 
    760739/** Wrapper for answering the IPC_M_SHARE_IN calls.
    761740 *
     
    784763int ipc_share_out_start(int phoneid, void *src, int flags)
    785764{
    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,
    787766            (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 calls
    793  * 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 will
    798  *                      be stored.
    799  * @param size          Storage where the source address space area size will be
    800  *                      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;
    819767}
    820768
     
    845793int ipc_data_read_start(int phoneid, void *dst, size_t size)
    846794{
    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,
    848796            (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 calls
    854  * 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 will
    859  *                      be stored.
    860  * @param size          Storage where the maximum size will be stored. Can be
    861  *                      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;
    877797}
    878798
     
    904824int ipc_data_write_start(int phoneid, const void *src, size_t size)
    905825{
    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,
    907827            (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 calls
    913  * 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 will
    918  *                      be stored.
    919  * @param size          Storage where the suggested size will be stored. May be
    920  *                      NULL
    921  *
    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;
    936828}
    937829
Note: See TracChangeset for help on using the changeset viewer.