Changes in / [f307f12:c123609] in mainline


Ignore:
Location:
uspace
Files:
1 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/klog/klog.c

    rf307f12 rc123609  
    7474        }
    7575       
    76         int res = async_share_in_start_1_0(PHONE_NS, (void *) klog,
     76        int res = ipc_share_in_start_1_0(PHONE_NS, (void *) klog,
    7777            klog_size, SERVICE_MEM_KLOG);
    7878        if (res != EOK) {
  • uspace/lib/libblock/libblock.c

    rf307f12 rc123609  
    168168        }
    169169
    170         rc = async_share_out_start(dev_phone, comm_area,
     170        rc = ipc_share_out_start(dev_phone, comm_area,
    171171            AS_AREA_READ | AS_AREA_WRITE);
    172172        if (rc != EOK) {
  • uspace/lib/libc/generic/async.c

    rf307f12 rc123609  
    8383 *
    8484 *     callid = async_get_call(&call);
    85  *     somehow_handle_the_call(callid, call);
     85 *     handle_call(callid, call);
    8686 *     ipc_answer_2(callid, 1, 2, 3);
    8787 *
     
    9494#include <futex.h>
    9595#include <async.h>
    96 #include <async_priv.h>
    9796#include <fibril.h>
    9897#include <stdio.h>
     
    111110atomic_t threads_in_ipc_wait = { 0 };
    112111
     112/** Structures of this type represent a waiting fibril. */
     113typedef struct {
     114        /** Expiration time. */
     115        struct timeval expires;
     116       
     117        /** If true, this struct is in the timeout list. */
     118        bool inlist;
     119       
     120        /** Timeout list link. */
     121        link_t link;
     122       
     123        /** Identification of and link to the waiting fibril. */
     124        fid_t fid;
     125       
     126        /** If true, this fibril is currently active. */
     127        bool active;
     128       
     129        /** If true, we have timed out. */
     130        bool timedout;
     131} awaiter_t;
     132
    113133typedef struct {
    114134        awaiter_t wdata;
     
    233253 *
    234254 */
    235 void async_insert_timeout(awaiter_t *wd)
    236 {
    237         wd->to_event.occurred = false;
    238         wd->to_event.inlist = true;
     255static void insert_timeout(awaiter_t *wd)
     256{
     257        wd->timedout = false;
     258        wd->inlist = true;
    239259       
    240260        link_t *tmp = timeout_list.next;
    241261        while (tmp != &timeout_list) {
    242                 awaiter_t *cur;
    243                
    244                 cur = list_get_instance(tmp, awaiter_t, to_event.link);
    245                 if (tv_gteq(&cur->to_event.expires, &wd->to_event.expires))
     262                awaiter_t *cur = list_get_instance(tmp, awaiter_t, link);
     263               
     264                if (tv_gteq(&cur->expires, &wd->expires))
    246265                        break;
     266               
    247267                tmp = tmp->next;
    248268        }
    249269       
    250         list_append(&wd->to_event.link, tmp);
     270        list_append(&wd->link, tmp);
    251271}
    252272
     
    295315               
    296316                /* If in timeout list, remove it */
    297                 if (conn->wdata.to_event.inlist) {
    298                         conn->wdata.to_event.inlist = false;
    299                         list_remove(&conn->wdata.to_event.link);
     317                if (conn->wdata.inlist) {
     318                        conn->wdata.inlist = false;
     319                        list_remove(&conn->wdata.link);
    300320                }
    301321               
     
    385405       
    386406        if (usecs) {
    387                 gettimeofday(&conn->wdata.to_event.expires, NULL);
    388                 tv_add(&conn->wdata.to_event.expires, usecs);
     407                gettimeofday(&conn->wdata.expires, NULL);
     408                tv_add(&conn->wdata.expires, usecs);
    389409        } else
    390                 conn->wdata.to_event.inlist = false;
     410                conn->wdata.inlist = false;
    391411       
    392412        /* If nothing in queue, wait until something arrives */
    393413        while (list_empty(&conn->msg_queue)) {
    394414                if (usecs)
    395                         async_insert_timeout(&conn->wdata);
     415                        insert_timeout(&conn->wdata);
    396416               
    397417                conn->wdata.active = false;
     
    410430                 */
    411431                futex_down(&async_futex);
    412                 if ((usecs) && (conn->wdata.to_event.occurred)
     432                if ((usecs) && (conn->wdata.timedout)
    413433                    && (list_empty(&conn->msg_queue))) {
    414434                        /* If we timed out -> exit */
     
    605625        link_t *cur = timeout_list.next;
    606626        while (cur != &timeout_list) {
    607                 awaiter_t *waiter;
    608                
    609                 waiter = list_get_instance(cur, awaiter_t, to_event.link);
    610                 if (tv_gt(&waiter->to_event.expires, &tv))
     627                awaiter_t *waiter = list_get_instance(cur, awaiter_t, link);
     628               
     629                if (tv_gt(&waiter->expires, &tv))
    611630                        break;
    612 
     631               
    613632                cur = cur->next;
    614 
    615                 list_remove(&waiter->to_event.link);
    616                 waiter->to_event.inlist = false;
    617                 waiter->to_event.occurred = true;
     633               
     634                list_remove(&waiter->link);
     635                waiter->inlist = false;
     636                waiter->timedout = true;
    618637               
    619638                /*
     
    652671                if (!list_empty(&timeout_list)) {
    653672                        awaiter_t *waiter = list_get_instance(timeout_list.next,
    654                             awaiter_t, to_event.link);
     673                            awaiter_t, link);
    655674                       
    656675                        struct timeval tv;
    657676                        gettimeofday(&tv, NULL);
    658677                       
    659                         if (tv_gteq(&tv, &waiter->to_event.expires)) {
     678                        if (tv_gteq(&tv, &waiter->expires)) {
    660679                                futex_up(&async_futex);
    661680                                handle_expired_timeouts();
    662681                                continue;
    663682                        } else
    664                                 timeout = tv_sub(&waiter->to_event.expires,
    665                                     &tv);
     683                                timeout = tv_sub(&waiter->expires, &tv);
    666684                } else
    667685                        timeout = SYNCH_NO_TIMEOUT;
     
    764782       
    765783        /* Remove message from timeout list */
    766         if (msg->wdata.to_event.inlist)
    767                 list_remove(&msg->wdata.to_event.link);
     784        if (msg->wdata.inlist)
     785                list_remove(&msg->wdata.link);
    768786       
    769787        msg->done = true;
     
    804822        msg->dataptr = dataptr;
    805823       
    806         msg->wdata.to_event.inlist = false;
     824        msg->wdata.inlist = false;
    807825        /* We may sleep in the next method, but it will use its own mechanism */
    808826        msg->wdata.active = true;
     
    844862        msg->dataptr = dataptr;
    845863       
    846         msg->wdata.to_event.inlist = false;
     864        msg->wdata.inlist = false;
    847865        /* We may sleep in next method, but it will use its own mechanism */
    848866        msg->wdata.active = true;
     
    873891        msg->wdata.fid = fibril_get_id();
    874892        msg->wdata.active = false;
    875         msg->wdata.to_event.inlist = false;
     893        msg->wdata.inlist = false;
    876894       
    877895        /* Leave the async_futex locked when entering this function */
     
    911929        }
    912930       
    913         gettimeofday(&msg->wdata.to_event.expires, NULL);
    914         tv_add(&msg->wdata.to_event.expires, timeout);
     931        gettimeofday(&msg->wdata.expires, NULL);
     932        tv_add(&msg->wdata.expires, timeout);
    915933       
    916934        msg->wdata.fid = fibril_get_id();
    917935        msg->wdata.active = false;
    918         async_insert_timeout(&msg->wdata);
     936        insert_timeout(&msg->wdata);
    919937       
    920938        /* Leave the async_futex locked when entering this function */
     
    952970        msg->wdata.active = false;
    953971       
    954         gettimeofday(&msg->wdata.to_event.expires, NULL);
    955         tv_add(&msg->wdata.to_event.expires, timeout);
     972        gettimeofday(&msg->wdata.expires, NULL);
     973        tv_add(&msg->wdata.expires, timeout);
    956974       
    957975        futex_down(&async_futex);
    958976       
    959         async_insert_timeout(&msg->wdata);
     977        insert_timeout(&msg->wdata);
    960978       
    961979        /* Leave the async_futex locked when entering this function */
     
    10871105}
    10881106
    1089 /** Wrapper for making IPC_M_SHARE_IN calls using the async framework.
    1090  *
    1091  * @param phoneid       Phone that will be used to contact the receiving side.
    1092  * @param dst           Destination address space area base.
    1093  * @param size          Size of the destination address space area.
    1094  * @param arg           User defined argument.
    1095  * @param flags         Storage where the received flags will be stored. Can be
    1096  *                      NULL.
    1097  *
    1098  * @return              Zero on success or a negative error code from errno.h.
    1099  */
    1100 int async_share_in_start(int phoneid, void *dst, size_t size, ipcarg_t arg,
    1101     int *flags)
    1102 {
    1103         int res;
    1104         sysarg_t tmp_flags;
    1105         res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst,
    1106             (ipcarg_t) size, arg, NULL, &tmp_flags);
    1107         if (flags)
    1108                 *flags = tmp_flags;
    1109         return res;
    1110 }
    1111 
    1112 /** Wrapper for receiving the IPC_M_SHARE_IN calls using the async framework.
    1113  *
    1114  * This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN calls
    1115  * so that the user doesn't have to remember the meaning of each IPC argument.
    1116  *
    1117  * So far, this wrapper is to be used from within a connection fibril.
    1118  *
    1119  * @param callid        Storage where the hash of the IPC_M_SHARE_IN call will
    1120  *                      be stored.
    1121  * @param size          Destination address space area size.   
    1122  *
    1123  * @return              Non-zero on success, zero on failure.
    1124  */
    1125 int async_share_in_receive(ipc_callid_t *callid, size_t *size)
    1126 {
    1127         ipc_call_t data;
    1128        
    1129         assert(callid);
    1130         assert(size);
    1131 
    1132         *callid = async_get_call(&data);
    1133         if (IPC_GET_METHOD(data) != IPC_M_SHARE_IN)
    1134                 return 0;
    1135         *size = (size_t) IPC_GET_ARG2(data);
    1136         return 1;
    1137 }
    1138 
    1139 /** Wrapper for answering the IPC_M_SHARE_IN calls using the async framework.
    1140  *
    1141  * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls
    1142  * so that the user doesn't have to remember the meaning of each IPC argument.
    1143  *
    1144  * @param callid        Hash of the IPC_M_DATA_READ call to answer.
    1145  * @param src           Source address space base.
    1146  * @param flags         Flags to be used for sharing. Bits can be only cleared.
    1147  *
    1148  * @return              Zero on success or a value from @ref errno.h on failure.
    1149  */
    1150 int async_share_in_finalize(ipc_callid_t callid, void *src, int flags)
    1151 {
    1152         return ipc_share_in_finalize(callid, src, flags);
    1153 }
    1154 
    1155 /** Wrapper for making IPC_M_SHARE_OUT calls using the async framework.
    1156  *
    1157  * @param phoneid       Phone that will be used to contact the receiving side.
    1158  * @param src           Source address space area base address.
    1159  * @param flags         Flags to be used for sharing. Bits can be only cleared.
    1160  *
    1161  * @return              Zero on success or a negative error code from errno.h.
    1162  */
    1163 int async_share_out_start(int phoneid, void *src, int flags)
    1164 {
    1165         return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0,
    1166             (ipcarg_t) flags);
    1167 }
    1168 
    1169 /** Wrapper for receiving the IPC_M_SHARE_OUT calls using the async framework.
    1170  *
    1171  * This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT calls
    1172  * so that the user doesn't have to remember the meaning of each IPC argument.
    1173  *
    1174  * So far, this wrapper is to be used from within a connection fibril.
    1175  *
    1176  * @param callid        Storage where the hash of the IPC_M_SHARE_OUT call will
    1177  *                      be stored.
    1178  * @param size          Storage where the source address space area size will be
    1179  *                      stored.
    1180  * @param flags         Storage where the sharing flags will be stored.
    1181  *
    1182  * @return              Non-zero on success, zero on failure.
    1183  */
    1184 int async_share_out_receive(ipc_callid_t *callid, size_t *size, int *flags)
    1185 {
    1186         ipc_call_t data;
    1187        
    1188         assert(callid);
    1189         assert(size);
    1190         assert(flags);
    1191 
    1192         *callid = async_get_call(&data);
    1193         if (IPC_GET_METHOD(data) != IPC_M_SHARE_OUT)
    1194                 return 0;
    1195         *size = (size_t) IPC_GET_ARG2(data);
    1196         *flags = (int) IPC_GET_ARG3(data);
    1197         return 1;
    1198 }
    1199 
    1200 /** Wrapper for answering the IPC_M_SHARE_OUT calls using the async framework.
    1201  *
    1202  * This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT calls
    1203  * so that the user doesn't have to remember the meaning of each IPC argument.
    1204  *
    1205  * @param callid        Hash of the IPC_M_DATA_WRITE call to answer.
    1206  * @param dst           Destination address space area base address.   
    1207  *
    1208  * @return              Zero on success or a value from @ref errno.h on failure.
    1209  */
    1210 int async_share_out_finalize(ipc_callid_t callid, void *dst)
    1211 {
    1212         return ipc_share_out_finalize(callid, dst);
    1213 }
    1214 
    1215 
    1216 /** Wrapper for making IPC_M_DATA_READ calls using the async framework.
    1217  *
    1218  * @param phoneid       Phone that will be used to contact the receiving side.
    1219  * @param dst           Address of the beginning of the destination buffer.
    1220  * @param size          Size of the destination buffer.
    1221  *
    1222  * @return              Zero on success or a negative error code from errno.h.
    1223  */
    1224 int async_data_read_start(int phoneid, void *dst, size_t size)
    1225 {
    1226         return async_req_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst,
    1227             (ipcarg_t) size);
    1228 }
    1229 
    1230 /** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework.
    1231  *
    1232  * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ calls
    1233  * so that the user doesn't have to remember the meaning of each IPC argument.
    1234  *
    1235  * So far, this wrapper is to be used from within a connection fibril.
    1236  *
    1237  * @param callid        Storage where the hash of the IPC_M_DATA_READ call will
    1238  *                      be stored.
    1239  * @param size          Storage where the maximum size will be stored. Can be
    1240  *                      NULL.
    1241  *
    1242  * @return              Non-zero on success, zero on failure.
    1243  */
    1244 int async_data_read_receive(ipc_callid_t *callid, size_t *size)
    1245 {
    1246         ipc_call_t data;
    1247        
    1248         assert(callid);
    1249 
    1250         *callid = async_get_call(&data);
    1251         if (IPC_GET_METHOD(data) != IPC_M_DATA_READ)
    1252                 return 0;
    1253         if (size)
    1254                 *size = (size_t) IPC_GET_ARG2(data);
    1255         return 1;
    1256 }
    1257 
    1258 /** Wrapper for answering the IPC_M_DATA_READ calls using the async framework.
    1259  *
    1260  * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls
    1261  * so that the user doesn't have to remember the meaning of each IPC argument.
    1262  *
    1263  * @param callid        Hash of the IPC_M_DATA_READ call to answer.
    1264  * @param src           Source address for the IPC_M_DATA_READ call.
    1265  * @param size          Size for the IPC_M_DATA_READ call. Can be smaller than
    1266  *                      the maximum size announced by the sender.
    1267  *
    1268  * @return              Zero on success or a value from @ref errno.h on failure.
    1269  */
    1270 int async_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
    1271 {
    1272         return ipc_data_read_finalize(callid, src, size);
    1273 }
    1274 
    1275 /** Wrapper for making IPC_M_DATA_WRITE calls using the async framework.
    1276  *
    1277  * @param phoneid       Phone that will be used to contact the receiving side.
    1278  * @param src           Address of the beginning of the source buffer.
    1279  * @param size          Size of the source buffer.
    1280  *
    1281  * @return              Zero on success or a negative error code from errno.h.
    1282  */
    1283 int async_data_write_start(int phoneid, const void *src, size_t size)
    1284 {
    1285         return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src,
    1286             (ipcarg_t) size);
    1287 }
    1288 
    1289 /** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework.
    1290  *
    1291  * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE calls
    1292  * so that the user doesn't have to remember the meaning of each IPC argument.
    1293  *
    1294  * So far, this wrapper is to be used from within a connection fibril.
    1295  *
    1296  * @param callid        Storage where the hash of the IPC_M_DATA_WRITE call will
    1297  *                      be stored.
    1298  * @param size          Storage where the suggested size will be stored. May be
    1299  *                      NULL
    1300  *
    1301  * @return              Non-zero on success, zero on failure.
    1302  */
    1303 int async_data_write_receive(ipc_callid_t *callid, size_t *size)
    1304 {
    1305         ipc_call_t data;
    1306        
    1307         assert(callid);
    1308 
    1309         *callid = async_get_call(&data);
    1310         if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE)
    1311                 return 0;
    1312         if (size)
    1313                 *size = (size_t) IPC_GET_ARG2(data);
    1314         return 1;
    1315 }
    1316 
    1317 /** Wrapper for answering the IPC_M_DATA_WRITE calls using the async framework.
    1318  *
    1319  * This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE calls
    1320  * so that the user doesn't have to remember the meaning of each IPC argument.
    1321  *
    1322  * @param callid        Hash of the IPC_M_DATA_WRITE call to answer.
    1323  * @param dst           Final destination address for the IPC_M_DATA_WRITE call.
    1324  * @param size          Final size for the IPC_M_DATA_WRITE call.
    1325  *
    1326  * @return              Zero on success or a value from @ref errno.h on failure.
    1327  */
    1328 int async_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
    1329 {
    1330         return ipc_data_write_finalize(callid, dst, size);
    1331 }
    1332 
    13331107/** @}
    13341108 */
  • uspace/lib/libc/generic/devmap.c

    rf307f12 rc123609  
    105105        aid_t req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer);
    106106       
    107         ipcarg_t retval = async_data_write_start(phone, name, str_size(name) + 1);
     107        ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1);
    108108       
    109109        if (retval != EOK) {
     
    143143            &answer);
    144144       
    145         ipcarg_t retval = async_data_write_start(phone, name, str_size(name) + 1);
     145        ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1);
    146146       
    147147        if (retval != EOK) {
     
    180180            &answer);
    181181       
    182         ipcarg_t retval = async_data_write_start(phone, name, str_size(name) + 1);
     182        ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1);
    183183       
    184184        if (retval != EOK) {
     
    271271        aid_t req = async_send_0(phone, DEVMAP_DEVICE_GET_DEVICES, &answer);
    272272       
    273         ipcarg_t retval = async_data_read_start(phone, data, count * sizeof(dev_desc_t));
     273        ipcarg_t retval = ipc_data_read_start(phone, data, count * sizeof(dev_desc_t));
    274274       
    275275        if (retval != EOK) {
  • uspace/lib/libc/generic/fibril_sync.c

    rf307f12 rc123609  
    3636#include <fibril.h>
    3737#include <async.h>
    38 #include <async_priv.h>
    3938#include <adt/list.h>
    4039#include <futex.h>
    41 #include <sys/time.h>
    42 #include <errno.h>
    4340#include <assert.h>
    4441
     
    6663        futex_down(&async_futex);
    6764        if (fm->counter-- <= 0) {
    68                 awaiter_t wdata;
    69 
    70                 wdata.fid = fibril_get_id();
    71                 wdata.active = false;
    72                 wdata.wu_event.inlist = true;
    73                 link_initialize(&wdata.wu_event.link);
    74                 list_append(&wdata.wu_event.link, &fm->waiters);
     65                fibril_t *f = (fibril_t *) fibril_get_id();
     66                list_append(&f->link, &fm->waiters);
    7567                fibril_switch(FIBRIL_TO_MANAGER);
    7668        } else {
     
    9890        if (fm->counter++ < 0) {
    9991                link_t *tmp;
    100                 awaiter_t *wdp;
     92                fibril_t *f;
    10193       
    10294                assert(!list_empty(&fm->waiters));
    10395                tmp = fm->waiters.next;
    104                 wdp = list_get_instance(tmp, awaiter_t, wu_event.link);
    105                 wdp->active = true;
    106                 wdp->wu_event.inlist = false;
    107                 list_remove(&wdp->wu_event.link);
    108                 fibril_add_ready(wdp->fid);
     96                f = list_get_instance(tmp, fibril_t, link);
     97                list_remove(&f->link);
     98                fibril_add_ready((fid_t) f);
    10999                optimize_execution_power();
    110100        }
     
    130120        if (frw->writers) {
    131121                fibril_t *f = (fibril_t *) fibril_get_id();
    132                 awaiter_t wdata;
    133 
    134                 wdata.fid = (fid_t) f;
    135                 wdata.active = false;
    136                 wdata.wu_event.inlist = true;
    137                 link_initialize(&wdata.wu_event.link);
    138122                f->flags &= ~FIBRIL_WRITER;
    139                 list_append(&wdata.wu_event.link, &frw->waiters);
     123                list_append(&f->link, &frw->waiters);
    140124                fibril_switch(FIBRIL_TO_MANAGER);
    141125        } else {
     
    150134        if (frw->writers || frw->readers) {
    151135                fibril_t *f = (fibril_t *) fibril_get_id();
    152                 awaiter_t wdata;
    153 
    154                 wdata.fid = (fid_t) f;
    155                 wdata.active = false;
    156                 wdata.wu_event.inlist = true;
    157                 link_initialize(&wdata.wu_event.link);
    158136                f->flags |= FIBRIL_WRITER;
    159                 list_append(&wdata.wu_event.link, &frw->waiters);
     137                list_append(&f->link, &frw->waiters);
    160138                fibril_switch(FIBRIL_TO_MANAGER);
    161139        } else {
     
    180158        while (!list_empty(&frw->waiters)) {
    181159                link_t *tmp = frw->waiters.next;
    182                 awaiter_t *wdp;
    183                 fibril_t *f;
    184                
    185                 wdp = list_get_instance(tmp, awaiter_t, wu_event.link);
    186                 f = (fibril_t *) wdp->fid;
     160                fibril_t *f = list_get_instance(tmp, fibril_t, link);
    187161               
    188162                if (f->flags & FIBRIL_WRITER) {
    189163                        if (frw->readers)
    190164                                break;
    191                         wdp->active = true;
    192                         wdp->wu_event.inlist = false;
    193                         list_remove(&wdp->wu_event.link);
    194                         fibril_add_ready(wdp->fid);
     165                        list_remove(&f->link);
     166                        fibril_add_ready((fid_t) f);
    195167                        frw->writers++;
    196168                        optimize_execution_power();
    197169                        break;
    198170                } else {
    199                         wdp->active = true;
    200                         wdp->wu_event.inlist = false;
    201                         list_remove(&wdp->wu_event.link);
    202                         fibril_add_ready(wdp->fid);
     171                        list_remove(&f->link);
     172                        fibril_add_ready((fid_t) f);
    203173                        frw->readers++;
    204174                        optimize_execution_power();
     
    224194}
    225195
    226 int
    227 fibril_condvar_wait_timeout(fibril_condvar_t *fcv, fibril_mutex_t *fm,
    228     suseconds_t timeout)
    229 {
    230         awaiter_t wdata;
    231 
    232         if (timeout < 0)
    233                 return ETIMEOUT;
    234 
    235         wdata.fid = fibril_get_id();
    236         wdata.active = false;
    237        
    238         wdata.to_event.inlist = timeout > 0;
    239         wdata.to_event.occurred = false;
    240         link_initialize(&wdata.to_event.link);
    241 
    242         wdata.wu_event.inlist = true;
    243         link_initialize(&wdata.wu_event.link);
    244 
    245         futex_down(&async_futex);
    246         if (timeout) {
    247                 gettimeofday(&wdata.to_event.expires, NULL);
    248                 tv_add(&wdata.to_event.expires, timeout);
    249                 async_insert_timeout(&wdata);
    250         }
    251         list_append(&wdata.wu_event.link, &fcv->waiters);
     196void fibril_condvar_wait(fibril_condvar_t *fcv, fibril_mutex_t *fm)
     197{
     198        fibril_t *f = (fibril_t *) fibril_get_id();
     199
     200        futex_down(&async_futex);
     201        list_append(&f->link, &fcv->waiters);
    252202        _fibril_mutex_unlock_unsafe(fm);
    253203        fibril_switch(FIBRIL_TO_MANAGER);
    254204        fibril_mutex_lock(fm);
    255 
    256         /* async_futex not held after fibril_switch() */
    257         futex_down(&async_futex);
    258         if (wdata.to_event.inlist)
    259                 list_remove(&wdata.to_event.link);
    260         if (wdata.wu_event.inlist)
    261                 list_remove(&wdata.wu_event.link);
    262         futex_up(&async_futex);
    263        
    264         return wdata.to_event.occurred ? ETIMEOUT : EOK;
    265 }
    266 
    267 void fibril_condvar_wait(fibril_condvar_t *fcv, fibril_mutex_t *fm)
    268 {
    269         int rc;
    270 
    271         rc = fibril_condvar_wait_timeout(fcv, fm, 0);
    272         assert(rc == EOK);
    273205}
    274206
     
    276208{
    277209        link_t *tmp;
    278         awaiter_t *wdp;
     210        fibril_t *f;
    279211
    280212        futex_down(&async_futex);
    281213        while (!list_empty(&fcv->waiters)) {
    282214                tmp = fcv->waiters.next;
    283                 wdp = list_get_instance(tmp, awaiter_t, wu_event.link);
    284                 list_remove(&wdp->wu_event.link);
    285                 wdp->wu_event.inlist = false;
    286                 if (!wdp->active) {
    287                         wdp->active = true;
    288                         fibril_add_ready(wdp->fid);
    289                         optimize_execution_power();
    290                         if (once)
    291                                 break;
    292                 }
     215                f = list_get_instance(tmp, fibril_t, link);
     216                list_remove(&f->link);
     217                fibril_add_ready((fid_t) f);
     218                optimize_execution_power();
     219                if (once)
     220                        break;
    293221        }
    294222        futex_up(&async_futex);
  • uspace/lib/libc/generic/ipc.c

    rf307f12 rc123609  
    730730        int res;
    731731        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,
    733733            (ipcarg_t) size, arg, NULL, &tmp_flags);
    734734        if (flags)
     
    737737}
    738738
     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 */
     752int 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
    739766/** Wrapper for answering the IPC_M_SHARE_IN calls.
    740767 *
     
    763790int ipc_share_out_start(int phoneid, void *src, int flags)
    764791{
    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,
    766793            (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 */
     811int 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;
    767825}
    768826
     
    793851int ipc_data_read_start(int phoneid, void *dst, size_t size)
    794852{
    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,
    796854            (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 */
     871int 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;
    797883}
    798884
     
    824910int ipc_data_write_start(int phoneid, const void *src, size_t size)
    825911{
    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,
    827913            (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 */
     930int 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;
    828942}
    829943
  • uspace/lib/libc/generic/loader.c

    rf307f12 rc123609  
    9090        ipc_call_t answer;
    9191        aid_t req = async_send_0(ldr->phone_id, LOADER_GET_TASKID, &answer);
    92         int rc = async_data_read_start(ldr->phone_id, task_id, sizeof(task_id_t));
     92        int rc = ipc_data_read_start(ldr->phone_id, task_id, sizeof(task_id_t));
    9393        if (rc != EOK) {
    9494                async_wait_for(req, NULL);
     
    123123        ipc_call_t answer;
    124124        aid_t req = async_send_0(ldr->phone_id, LOADER_SET_PATHNAME, &answer);
    125         int rc = async_data_write_start(ldr->phone_id, (void *) pa, pa_len);
     125        int rc = ipc_data_write_start(ldr->phone_id, (void *) pa, pa_len);
    126126        if (rc != EOK) {
    127127                async_wait_for(req, NULL);
     
    178178        ipc_call_t answer;
    179179        aid_t req = async_send_0(ldr->phone_id, LOADER_SET_ARGS, &answer);
    180         ipcarg_t rc = async_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size);
     180        ipcarg_t rc = ipc_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size);
    181181        if (rc != EOK) {
    182182                async_wait_for(req, NULL);
     
    232232        ipc_call_t answer;
    233233        aid_t req = async_send_0(ldr->phone_id, LOADER_SET_FILES, &answer);
    234         ipcarg_t rc = async_data_write_start(ldr->phone_id, (void *) files_buf,
     234        ipcarg_t rc = ipc_data_write_start(ldr->phone_id, (void *) files_buf,
    235235            count * sizeof(fdi_node_t));
    236236        if (rc != EOK) {
  • uspace/lib/libc/generic/vfs/vfs.c

    rf307f12 rc123609  
    140140       
    141141        req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL);
    142         rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
     142        rc = ipc_data_write_start(vfs_phone, (void *) mpa, mpa_size);
    143143        if (rc != EOK) {
    144144                async_wait_for(req, &rc_orig);
     
    152152        }
    153153       
    154         rc = async_data_write_start(vfs_phone, (void *) opts, str_size(opts));
     154        rc = ipc_data_write_start(vfs_phone, (void *) opts, str_size(opts));
    155155        if (rc != EOK) {
    156156                async_wait_for(req, &rc_orig);
     
    164164        }
    165165
    166         rc = async_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name));
     166        rc = ipc_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name));
    167167        if (rc != EOK) {
    168168                async_wait_for(req, &rc_orig);
     
    213213       
    214214        req = async_send_3(vfs_phone, VFS_IN_OPEN, lflag, oflag, 0, &answer);
    215         rc = async_data_write_start(vfs_phone, pa, pa_size);
     215        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    216216        if (rc != EOK) {
    217217                ipcarg_t rc_orig;
     
    290290       
    291291        req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer);
    292         rc = async_data_read_start(vfs_phone, (void *)buf, nbyte);
     292        rc = ipc_data_read_start(vfs_phone, (void *)buf, nbyte);
    293293        if (rc != EOK) {
    294294                ipcarg_t rc_orig;
     
    322322       
    323323        req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer);
    324         rc = async_data_write_start(vfs_phone, (void *)buf, nbyte);
     324        rc = ipc_data_write_start(vfs_phone, (void *)buf, nbyte);
    325325        if (rc != EOK) {
    326326                ipcarg_t rc_orig;
     
    402402       
    403403        req = async_send_1(vfs_phone, VFS_IN_FSTAT, fildes, NULL);
    404         rc = async_data_read_start(vfs_phone, (void *)stat, sizeof(struct stat));
     404        rc = ipc_data_read_start(vfs_phone, (void *)stat, sizeof(struct stat));
    405405        if (rc != EOK) {
    406406                ipcarg_t rc_orig;
     
    437437       
    438438        req = async_send_0(vfs_phone, VFS_IN_STAT, NULL);
    439         rc = async_data_write_start(vfs_phone, pa, pa_size);
     439        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    440440        if (rc != EOK) {
    441441                async_wait_for(req, &rc_orig);
     
    448448                        return (int) rc_orig;
    449449        }
    450         rc = async_data_read_start(vfs_phone, stat, sizeof(struct stat));
     450        rc = ipc_data_read_start(vfs_phone, stat, sizeof(struct stat));
    451451        if (rc != EOK) {
    452452                async_wait_for(req, &rc_orig);
     
    514514       
    515515        req = async_send_1(vfs_phone, VFS_IN_MKDIR, mode, NULL);
    516         rc = async_data_write_start(vfs_phone, pa, pa_size);
     516        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    517517        if (rc != EOK) {
    518518                ipcarg_t rc_orig;
     
    549549       
    550550        req = async_send_0(vfs_phone, VFS_IN_UNLINK, NULL);
    551         rc = async_data_write_start(vfs_phone, pa, pa_size);
     551        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    552552        if (rc != EOK) {
    553553                ipcarg_t rc_orig;
     
    602602       
    603603        req = async_send_0(vfs_phone, VFS_IN_RENAME, NULL);
    604         rc = async_data_write_start(vfs_phone, olda, olda_size);
     604        rc = ipc_data_write_start(vfs_phone, olda, olda_size);
    605605        if (rc != EOK) {
    606606                async_wait_for(req, &rc_orig);
     
    614614                        return (int) rc_orig;
    615615        }
    616         rc = async_data_write_start(vfs_phone, newa, newa_size);
     616        rc = ipc_data_write_start(vfs_phone, newa, newa_size);
    617617        if (rc != EOK) {
    618618                async_wait_for(req, &rc_orig);
  • uspace/lib/libc/include/async.h

    rf307f12 rc123609  
    259259}
    260260
    261 /*
    262  * User-friendly wrappers for async_share_in_start().
    263  */
    264 #define async_share_in_start_0_0(phoneid, dst, size) \
    265         async_share_in_start((phoneid), (dst), (size), 0, NULL)
    266 #define async_share_in_start_0_1(phoneid, dst, size, flags) \
    267         async_share_in_start((phoneid), (dst), (size), 0, (flags))
    268 #define async_share_in_start_1_0(phoneid, dst, size, arg) \
    269         async_share_in_start((phoneid), (dst), (size), (arg), NULL)
    270 #define async_share_in_start_1_1(phoneid, dst, size, arg, flags) \
    271         async_share_in_start((phoneid), (dst), (size), (arg), (flags))
    272 
    273 extern int async_share_in_start(int, void *, size_t, ipcarg_t, int *);
    274 extern int async_share_in_receive(ipc_callid_t *, size_t *);
    275 extern int async_share_in_finalize(ipc_callid_t, void *, int );
    276 extern int async_share_out_start(int, void *, int);
    277 extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
    278 extern int async_share_out_finalize(ipc_callid_t, void *);
    279 extern int async_data_read_start(int, void *, size_t);
    280 extern int async_data_read_receive(ipc_callid_t *, size_t *);
    281 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    282 extern int async_data_write_start(int, const void *, size_t);
    283 extern int async_data_write_receive(ipc_callid_t *, size_t *);
    284 extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
    285 
    286261#endif
    287262
  • uspace/lib/libc/include/fibril_sync.h

    rf307f12 rc123609  
    4040#include <adt/list.h>
    4141#include <libarch/tls.h>
    42 #include <sys/time.h>
    4342
    4443typedef struct {
     
    9695
    9796extern void fibril_condvar_initialize(fibril_condvar_t *);
    98 extern int fibril_condvar_wait_timeout(fibril_condvar_t *, fibril_mutex_t *,
    99     suseconds_t);
    10097extern void fibril_condvar_wait(fibril_condvar_t *, fibril_mutex_t *);
    10198extern void fibril_condvar_signal(fibril_condvar_t *);
  • uspace/lib/libc/include/ipc/ipc.h

    rf307f12 rc123609  
    283283
    284284extern int ipc_share_in_start(int, void *, size_t, ipcarg_t, int *);
     285extern int ipc_share_in_receive(ipc_callid_t *, size_t *);
    285286extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
    286287extern int ipc_share_out_start(int, void *, int);
     288extern int ipc_share_out_receive(ipc_callid_t *, size_t *, int *);
    287289extern int ipc_share_out_finalize(ipc_callid_t, void *);
    288290extern int ipc_data_read_start(int, void *, size_t);
     291extern int ipc_data_read_receive(ipc_callid_t *, size_t *);
    289292extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);
    290293extern int ipc_data_write_start(int, const void *, size_t);
     294extern int ipc_data_write_receive(ipc_callid_t *, size_t *);
    291295extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t);
    292296
  • uspace/lib/libfs/libfs.c

    rf307f12 rc123609  
    9191         * Send our VFS info structure to VFS.
    9292         */
    93         int rc = async_data_write_start(vfs_phone, info, sizeof(*info));
     93        int rc = ipc_data_write_start(vfs_phone, info, sizeof(*info));
    9494        if (rc != EOK) {
    9595                async_wait_for(req, NULL);
     
    114114         * Request sharing the Path Lookup Buffer with VFS.
    115115         */
    116         rc = async_share_in_start_0_0(vfs_phone, reg->plb_ro, PLB_SIZE);
     116        rc = ipc_share_in_start_0_0(vfs_phone, reg->plb_ro, PLB_SIZE);
    117117        if (rc) {
    118118                async_wait_for(req, NULL);
     
    169169        ipc_answer_0(callid, EOK);      /* acknowledge the mountee_phone */
    170170       
    171         res = async_data_write_receive(&callid, NULL);
     171        res = ipc_data_write_receive(&callid, NULL);
    172172        if (!res) {
    173173                ipc_hangup(mountee_phone);
     
    486486        ipc_callid_t callid;
    487487        size_t size;
    488         if (!async_data_read_receive(&callid, &size) ||
     488        if (!ipc_data_read_receive(&callid, &size) ||
    489489            size != sizeof(struct stat)) {
    490490                ipc_answer_0(callid, EINVAL);
     
    503503        stat.size = ops->size_get(fn);
    504504
    505         async_data_read_finalize(callid, &stat, sizeof(struct stat));
     505        ipc_data_read_finalize(callid, &stat, sizeof(struct stat));
    506506        ipc_answer_0(rid, EOK);
    507507}
  • uspace/srv/bd/ata_bd/ata_bd.c

    rf307f12 rc123609  
    252252        ipc_answer_0(iid, EOK);
    253253
    254         if (!async_share_out_receive(&callid, &comm_size, &flags)) {
     254        if (!ipc_share_out_receive(&callid, &comm_size, &flags)) {
    255255                ipc_answer_0(callid, EHANGUP);
    256256                return;
     
    263263        }
    264264
    265         (void) async_share_out_finalize(callid, fs_va);
     265        (void) ipc_share_out_finalize(callid, fs_va);
    266266
    267267        while (1) {
  • uspace/srv/bd/file_bd/file_bd.c

    rf307f12 rc123609  
    130130        ipc_answer_0(iid, EOK);
    131131
    132         if (!async_share_out_receive(&callid, &comm_size, &flags)) {
     132        if (!ipc_share_out_receive(&callid, &comm_size, &flags)) {
    133133                ipc_answer_0(callid, EHANGUP);
    134134                return;
     
    141141        }
    142142
    143         (void) async_share_out_finalize(callid, fs_va);
     143        (void) ipc_share_out_finalize(callid, fs_va);
    144144
    145145        while (1) {
  • uspace/srv/bd/gxe_bd/gxe_bd.c

    rf307f12 rc123609  
    185185        ipc_answer_0(iid, EOK);
    186186
    187         if (!async_share_out_receive(&callid, &comm_size, &flags)) {
     187        if (!ipc_share_out_receive(&callid, &comm_size, &flags)) {
    188188                ipc_answer_0(callid, EHANGUP);
    189189                return;
     
    201201        }
    202202
    203         (void) async_share_out_finalize(callid, fs_va);
     203        (void) ipc_share_out_finalize(callid, fs_va);
    204204
    205205        while (1) {
  • uspace/srv/bd/rd/rd.c

    rf307f12 rc123609  
    102102         */
    103103        int flags;
    104         if (async_share_out_receive(&callid, &comm_size, &flags)) {
     104        if (ipc_share_out_receive(&callid, &comm_size, &flags)) {
    105105                fs_va = as_get_mappable_page(comm_size);
    106106                if (fs_va) {
    107                         (void) async_share_out_finalize(callid, fs_va);
     107                        (void) ipc_share_out_finalize(callid, fs_va);
    108108                } else {
    109109                        ipc_answer_0(callid, EHANGUP);
  • uspace/srv/console/console.c

    rf307f12 rc123609  
    429429        ipc_callid_t callid;
    430430        size_t size;
    431         if (!async_data_write_receive(&callid, &size)) {
     431        if (!ipc_data_write_receive(&callid, &size)) {
    432432                ipc_answer_0(callid, EINVAL);
    433433                ipc_answer_0(rid, EINVAL);
     
    442442        }
    443443       
    444         (void) async_data_write_finalize(callid, buf, size);
     444        (void) ipc_data_write_finalize(callid, buf, size);
    445445       
    446446        async_serialize_start();
     
    464464        ipc_callid_t callid;
    465465        size_t size;
    466         if (!async_data_read_receive(&callid, &size)) {
     466        if (!ipc_data_read_receive(&callid, &size)) {
    467467                ipc_answer_0(callid, EINVAL);
    468468                ipc_answer_0(rid, EINVAL);
     
    489489       
    490490        if (pos == size) {
    491                 (void) async_data_read_finalize(callid, buf, size);
     491                (void) ipc_data_read_finalize(callid, buf, size);
    492492                ipc_answer_1(rid, EOK, size);
    493493                free(buf);
     
    713713       
    714714        if (interbuffer) {
    715                 if (async_share_out_start(fb_info.phone, interbuffer,
     715                if (ipc_share_out_start(fb_info.phone, interbuffer,
    716716                    AS_AREA_READ) != EOK) {
    717717                        as_area_destroy(interbuffer);
  • uspace/srv/console/gcons.c

    rf307f12 rc123609  
    339339                goto exit;
    340340       
    341         rc = async_share_out_start(fbphone, shm, PROTO_READ);
     341        rc = ipc_share_out_start(fbphone, shm, PROTO_READ);
    342342        if (rc)
    343343                goto drop;
     
    409409                goto exit;
    410410       
    411         rc = async_share_out_start(fbphone, shm, PROTO_READ);
     411        rc = ipc_share_out_start(fbphone, shm, PROTO_READ);
    412412        if (rc)
    413413                goto drop;
  • uspace/srv/devmap/devmap.c

    rf307f12 rc123609  
    213213        ipc_callid_t callid;
    214214        size_t name_size;
    215         if (!async_data_write_receive(&callid, &name_size)) {
     215        if (!ipc_data_write_receive(&callid, &name_size)) {
    216216                free(driver);
    217217                ipc_answer_0(callid, EREFUSED);
     
    241241         * Send confirmation to sender and get data into buffer.
    242242         */
    243         if (async_data_write_finalize(callid, driver->name, name_size) != EOK) {
     243        if (ipc_data_write_finalize(callid, driver->name, name_size) != EOK) {
    244244                free(driver->name);
    245245                free(driver);
     
    358358        ipc_callid_t callid;
    359359        size_t size;
    360         if (!async_data_write_receive(&callid, &size)) {
     360        if (!ipc_data_write_receive(&callid, &size)) {
    361361                free(device);
    362362                ipc_answer_0(iid, EREFUSED);
     
    381381        }
    382382       
    383         async_data_write_finalize(callid, device->name, size);
     383        ipc_data_write_finalize(callid, device->name, size);
    384384        device->name[size] = 0;
    385385       
     
    466466        ipc_callid_t callid;
    467467        size_t size;
    468         if (!async_data_write_receive(&callid, &size)) {
     468        if (!ipc_data_write_receive(&callid, &size)) {
    469469                ipc_answer_0(callid, EREFUSED);
    470470                ipc_answer_0(iid, EREFUSED);
     
    491491         * Send confirmation to sender and get data into buffer.
    492492         */
    493         ipcarg_t retval = async_data_write_finalize(callid, name, size);
     493        ipcarg_t retval = ipc_data_write_finalize(callid, name, size);
    494494        if (retval != EOK) {
    495495                ipc_answer_0(iid, EREFUSED);
     
    553553         * size_t name_size = str_size(device->name);
    554554         *
    555          * int rc = async_data_write_send(phone, device->name, name_size);
     555         * int rc = ipc_data_write_send(phone, device->name, name_size);
    556556         * if (rc != EOK) {
    557557         *     async_wait_for(req, NULL);
     
    576576        ipc_callid_t callid;
    577577        size_t size;
    578         if (!async_data_read_receive(&callid, &size)) {
     578        if (!ipc_data_read_receive(&callid, &size)) {
    579579                ipc_answer_0(callid, EREFUSED);
    580580                ipc_answer_0(iid, EREFUSED);
     
    608608        }
    609609       
    610         ipcarg_t retval = async_data_read_finalize(callid, desc, pos * sizeof(dev_desc_t));
     610        ipcarg_t retval = ipc_data_read_finalize(callid, desc, pos * sizeof(dev_desc_t));
    611611        if (retval != EOK) {
    612612                ipc_answer_0(iid, EREFUSED);
  • uspace/srv/fs/devfs/devfs_ops.c

    rf307f12 rc123609  
    108108        ipc_callid_t callid;
    109109        size_t size;
    110         if (!async_data_write_receive(&callid, &size)) {
     110        if (!ipc_data_write_receive(&callid, &size)) {
    111111                ipc_answer_0(callid, EINVAL);
    112112                ipc_answer_0(rid, EINVAL);
     
    121121        }
    122122       
    123         ipcarg_t retval = async_data_write_finalize(callid, opts, size);
     123        ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);
    124124        if (retval != EOK) {
    125125                ipc_answer_0(rid, retval);
     
    286286        ipc_callid_t callid;
    287287        size_t size;
    288         if (!async_data_read_receive(&callid, &size) ||
     288        if (!ipc_data_read_receive(&callid, &size) ||
    289289            size != sizeof(struct stat)) {
    290290                ipc_answer_0(callid, EINVAL);
     
    315315        }
    316316
    317         async_data_read_finalize(callid, &stat, sizeof(struct stat));
     317        ipc_data_read_finalize(callid, &stat, sizeof(struct stat));
    318318        ipc_answer_0(rid, EOK);
    319319}
     
    340340               
    341341                ipc_callid_t callid;
    342                 if (!async_data_read_receive(&callid, NULL)) {
     342                if (!ipc_data_read_receive(&callid, NULL)) {
    343343                        fibril_mutex_unlock(&devices_mutex);
    344344                        ipc_answer_0(callid, EINVAL);
     
    367367                ipc_callid_t callid;
    368368                size_t size;
    369                 if (!async_data_read_receive(&callid, &size)) {
     369                if (!ipc_data_read_receive(&callid, &size)) {
    370370                        ipc_answer_0(callid, EINVAL);
    371371                        ipc_answer_0(rid, EINVAL);
     
    384384               
    385385                if (pos < max) {
    386                         async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
     386                        ipc_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
    387387                } else {
    388388                        ipc_answer_0(callid, ENOENT);
     
    418418               
    419419                ipc_callid_t callid;
    420                 if (!async_data_write_receive(&callid, NULL)) {
     420                if (!ipc_data_write_receive(&callid, NULL)) {
    421421                        fibril_mutex_unlock(&devices_mutex);
    422422                        ipc_answer_0(callid, EINVAL);
  • uspace/srv/fs/fat/fat_ops.c

    rf307f12 rc123609  
    897897        ipc_callid_t callid;
    898898        size_t size;
    899         if (!async_data_write_receive(&callid, &size)) {
     899        if (!ipc_data_write_receive(&callid, &size)) {
    900900                ipc_answer_0(callid, EINVAL);
    901901                ipc_answer_0(rid, EINVAL);
     
    908908                return;
    909909        }
    910         ipcarg_t retval = async_data_write_finalize(callid, opts, size);
     910        ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);
    911911        if (retval != EOK) {
    912912                ipc_answer_0(rid, retval);
     
    10471047        ipc_callid_t callid;
    10481048        size_t len;
    1049         if (!async_data_read_receive(&callid, &len)) {
     1049        if (!ipc_data_read_receive(&callid, &len)) {
    10501050                fat_node_put(fn);
    10511051                ipc_answer_0(callid, EINVAL);
     
    10661066                        /* reading beyond the EOF */
    10671067                        bytes = 0;
    1068                         (void) async_data_read_finalize(callid, NULL, 0);
     1068                        (void) ipc_data_read_finalize(callid, NULL, 0);
    10691069                } else {
    10701070                        bytes = min(len, bps - pos % bps);
     
    10731073                            BLOCK_FLAGS_NONE);
    10741074                        assert(rc == EOK);
    1075                         (void) async_data_read_finalize(callid, b->data + pos % bps,
     1075                        (void) ipc_data_read_finalize(callid, b->data + pos % bps,
    10761076                            bytes);
    10771077                        rc = block_put(b);
     
    11311131                return;
    11321132hit:
    1133                 (void) async_data_read_finalize(callid, name, str_size(name) + 1);
     1133                (void) ipc_data_read_finalize(callid, name, str_size(name) + 1);
    11341134                bytes = (pos - spos) + 1;
    11351135        }
     
    11691169        ipc_callid_t callid;
    11701170        size_t len;
    1171         if (!async_data_write_receive(&callid, &len)) {
     1171        if (!ipc_data_write_receive(&callid, &len)) {
    11721172                fat_node_put(fn);
    11731173                ipc_answer_0(callid, EINVAL);
     
    12041204                rc = fat_block_get(&b, bs, nodep, pos / bps, flags);
    12051205                assert(rc == EOK);
    1206                 (void) async_data_write_finalize(callid, b->data + pos % bps,
     1206                (void) ipc_data_write_finalize(callid, b->data + pos % bps,
    12071207                    bytes);
    12081208                b->dirty = true;                /* need to sync block */
     
    12411241                    flags);
    12421242                assert(rc == EOK);
    1243                 (void) async_data_write_finalize(callid, b->data + pos % bps,
     1243                (void) ipc_data_write_finalize(callid, b->data + pos % bps,
    12441244                    bytes);
    12451245                b->dirty = true;                /* need to sync block */
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    rf307f12 rc123609  
    389389        ipc_callid_t callid;
    390390        size_t size;
    391         if (!async_data_write_receive(&callid, &size)) {
     391        if (!ipc_data_write_receive(&callid, &size)) {
    392392                ipc_answer_0(callid, EINVAL);
    393393                ipc_answer_0(rid, EINVAL);
     
    400400                return;
    401401        }
    402         ipcarg_t retval = async_data_write_finalize(callid, opts, size);
     402        ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);
    403403        if (retval != EOK) {
    404404                ipc_answer_0(rid, retval);
     
    467467        ipc_callid_t callid;
    468468        size_t size;
    469         if (!async_data_read_receive(&callid, &size)) {
     469        if (!ipc_data_read_receive(&callid, &size)) {
    470470                ipc_answer_0(callid, EINVAL);   
    471471                ipc_answer_0(rid, EINVAL);
     
    476476        if (nodep->type == TMPFS_FILE) {
    477477                bytes = max(0, min(nodep->size - pos, size));
    478                 (void) async_data_read_finalize(callid, nodep->data + pos,
     478                (void) ipc_data_read_finalize(callid, nodep->data + pos,
    479479                    bytes);
    480480        } else {
     
    503503                dentryp = list_get_instance(lnk, tmpfs_dentry_t, link);
    504504
    505                 (void) async_data_read_finalize(callid, dentryp->name,
     505                (void) ipc_data_read_finalize(callid, dentryp->name,
    506506                    str_size(dentryp->name) + 1);
    507507                bytes = 1;
     
    541541        ipc_callid_t callid;
    542542        size_t size;
    543         if (!async_data_write_receive(&callid, &size)) {
     543        if (!ipc_data_write_receive(&callid, &size)) {
    544544                ipc_answer_0(callid, EINVAL);   
    545545                ipc_answer_0(rid, EINVAL);
     
    552552        if (pos + size <= nodep->size) {
    553553                /* The file size is not changing. */
    554                 (void) async_data_write_finalize(callid, nodep->data + pos, size);
     554                (void) ipc_data_write_finalize(callid, nodep->data + pos, size);
    555555                ipc_answer_2(rid, EOK, size, nodep->size);
    556556                return;
     
    574574        nodep->size += delta;
    575575        nodep->data = newdata;
    576         (void) async_data_write_finalize(callid, nodep->data + pos, size);
     576        (void) ipc_data_write_finalize(callid, nodep->data + pos, size);
    577577        ipc_answer_2(rid, EOK, size, nodep->size);
    578578}
  • uspace/srv/loader/main.c

    rf307f12 rc123609  
    102102        task_id = task_get_id();
    103103       
    104         if (!async_data_read_receive(&callid, &len)) {
     104        if (!ipc_data_read_receive(&callid, &len)) {
    105105                ipc_answer_0(callid, EINVAL);
    106106                ipc_answer_0(rid, EINVAL);
     
    111111                len = sizeof(task_id);
    112112       
    113         async_data_read_finalize(callid, &task_id, len);
     113        ipc_data_read_finalize(callid, &task_id, len);
    114114        ipc_answer_0(rid, EOK);
    115115}
     
    127127        char *name_buf;
    128128       
    129         if (!async_data_write_receive(&callid, &len)) {
     129        if (!ipc_data_write_receive(&callid, &len)) {
    130130                ipc_answer_0(callid, EINVAL);
    131131                ipc_answer_0(rid, EINVAL);
     
    140140        }
    141141       
    142         async_data_write_finalize(callid, name_buf, len);
     142        ipc_data_write_finalize(callid, name_buf, len);
    143143        ipc_answer_0(rid, EOK);
    144144       
     
    164164        int n;
    165165       
    166         if (!async_data_write_receive(&callid, &buf_size)) {
     166        if (!ipc_data_write_receive(&callid, &buf_size)) {
    167167                ipc_answer_0(callid, EINVAL);
    168168                ipc_answer_0(rid, EINVAL);
     
    187187        }
    188188       
    189         async_data_write_finalize(callid, arg_buf, buf_size);
     189        ipc_data_write_finalize(callid, arg_buf, buf_size);
    190190       
    191191        arg_buf[buf_size] = '\0';
     
    239239        ipc_callid_t callid;
    240240        size_t buf_size;
    241         if (!async_data_write_receive(&callid, &buf_size)) {
     241        if (!ipc_data_write_receive(&callid, &buf_size)) {
    242242                ipc_answer_0(callid, EINVAL);
    243243                ipc_answer_0(rid, EINVAL);
     
    268268        }
    269269       
    270         async_data_write_finalize(callid, fil_buf, buf_size);
     270        ipc_data_write_finalize(callid, fil_buf, buf_size);
    271271       
    272272        int count = buf_size / sizeof(fdi_node_t);
  • uspace/srv/part/mbr_part/mbr_part.c

    rf307f12 rc123609  
    419419        ipc_answer_0(iid, EOK);
    420420
    421         if (!async_share_out_receive(&callid, &comm_size, &flags)) {
     421        if (!ipc_share_out_receive(&callid, &comm_size, &flags)) {
    422422                ipc_answer_0(callid, EHANGUP);
    423423                return;
     
    430430        }
    431431
    432         (void) async_share_out_finalize(callid, fs_va);
     432        (void) ipc_share_out_finalize(callid, fs_va);
    433433
    434434        while (1) {
  • uspace/srv/vfs/vfs_ops.c

    rf307f12 rc123609  
    125125                            (ipcarg_t) dev_handle, &answer);
    126126                        /* send the mount options */
    127                         rc = async_data_write_start(phone, (void *)opts,
     127                        rc = ipc_data_write_start(phone, (void *)opts,
    128128                            str_size(opts));
    129129                        if (rc != EOK) {
     
    207207       
    208208        /* send the mount options */
    209         rc = async_data_write_start(phone, (void *)opts, str_size(opts));
     209        rc = ipc_data_write_start(phone, (void *)opts, str_size(opts));
    210210        if (rc != EOK) {
    211211                async_wait_for(msg, NULL);
     
    268268        ipc_callid_t callid;
    269269        size_t size;
    270         if (!async_data_write_receive(&callid, &size)) {
     270        if (!ipc_data_write_receive(&callid, &size)) {
    271271                ipc_answer_0(callid, EINVAL);
    272272                ipc_answer_0(rid, EINVAL);
     
    290290       
    291291        /* Deliver the mount point. */
    292         ipcarg_t retval = async_data_write_finalize(callid, mp, size);
     292        ipcarg_t retval = ipc_data_write_finalize(callid, mp, size);
    293293        if (retval != EOK) {
    294294                ipc_answer_0(rid, retval);
     
    299299       
    300300        /* Now we expect to receive the mount options. */
    301         if (!async_data_write_receive(&callid, &size)) {
     301        if (!ipc_data_write_receive(&callid, &size)) {
    302302                ipc_answer_0(callid, EINVAL);
    303303                ipc_answer_0(rid, EINVAL);
     
    324324
    325325        /* Deliver the mount options. */
    326         retval = async_data_write_finalize(callid, opts, size);
     326        retval = ipc_data_write_finalize(callid, opts, size);
    327327        if (retval != EOK) {
    328328                ipc_answer_0(rid, retval);
     
    337337         * system.
    338338         */
    339         if (!async_data_write_receive(&callid, &size)) {
     339        if (!ipc_data_write_receive(&callid, &size)) {
    340340                ipc_answer_0(callid, EINVAL);
    341341                ipc_answer_0(rid, EINVAL);
     
    370370       
    371371        /* Deliver the file system name. */
    372         retval = async_data_write_finalize(callid, fs_name, size);
     372        retval = ipc_data_write_finalize(callid, fs_name, size);
    373373        if (retval != EOK) {
    374374                ipc_answer_0(rid, retval);
     
    469469       
    470470        ipc_callid_t callid;
    471         if (!async_data_write_receive(&callid, &len)) {
     471        if (!ipc_data_write_receive(&callid, &len)) {
    472472                ipc_answer_0(callid, EINVAL);
    473473                ipc_answer_0(rid, EINVAL);
     
    483483       
    484484        int rc;
    485         if ((rc = async_data_write_finalize(callid, path, len))) {
     485        if ((rc = ipc_data_write_finalize(callid, path, len))) {
    486486                ipc_answer_0(rid, rc);
    487487                free(path);
     
    747747        int res;
    748748        if (read)
    749                 res = async_data_read_receive(&callid, NULL);
     749                res = ipc_data_read_receive(&callid, NULL);
    750750        else
    751                 res = async_data_write_receive(&callid, NULL);
     751                res = ipc_data_write_receive(&callid, NULL);
    752752        if (!res) {
    753753                ipc_answer_0(callid, EINVAL);
     
    943943
    944944        ipc_callid_t callid;
    945         if (!async_data_read_receive(&callid, NULL)) {
     945        if (!ipc_data_read_receive(&callid, NULL)) {
    946946                ipc_answer_0(callid, EINVAL);
    947947                ipc_answer_0(rid, EINVAL);
     
    969969        ipc_callid_t callid;
    970970
    971         if (!async_data_write_receive(&callid, &len)) {
     971        if (!ipc_data_write_receive(&callid, &len)) {
    972972                ipc_answer_0(callid, EINVAL);
    973973                ipc_answer_0(rid, EINVAL);
     
    981981        }
    982982        int rc;
    983         if ((rc = async_data_write_finalize(callid, path, len))) {
     983        if ((rc = ipc_data_write_finalize(callid, path, len))) {
    984984                ipc_answer_0(rid, rc);
    985985                free(path);
     
    988988        path[len] = '\0';
    989989
    990         if (!async_data_read_receive(&callid, NULL)) {
     990        if (!ipc_data_read_receive(&callid, NULL)) {
    991991                free(path);
    992992                ipc_answer_0(callid, EINVAL);
     
    10371037        ipc_callid_t callid;
    10381038
    1039         if (!async_data_write_receive(&callid, &len)) {
     1039        if (!ipc_data_write_receive(&callid, &len)) {
    10401040                ipc_answer_0(callid, EINVAL);
    10411041                ipc_answer_0(rid, EINVAL);
     
    10491049        }
    10501050        int rc;
    1051         if ((rc = async_data_write_finalize(callid, path, len))) {
     1051        if ((rc = ipc_data_write_finalize(callid, path, len))) {
    10521052                ipc_answer_0(rid, rc);
    10531053                free(path);
     
    10741074        ipc_callid_t callid;
    10751075
    1076         if (!async_data_write_receive(&callid, &len)) {
     1076        if (!ipc_data_write_receive(&callid, &len)) {
    10771077                ipc_answer_0(callid, EINVAL);
    10781078                ipc_answer_0(rid, EINVAL);
     
    10861086        }
    10871087        int rc;
    1088         if ((rc = async_data_write_finalize(callid, path, len))) {
     1088        if ((rc = ipc_data_write_finalize(callid, path, len))) {
    10891089                ipc_answer_0(rid, rc);
    10901090                free(path);
     
    11251125
    11261126        /* Retrieve the old path. */
    1127         if (!async_data_write_receive(&callid, &olen)) {
     1127        if (!ipc_data_write_receive(&callid, &olen)) {
    11281128                ipc_answer_0(callid, EINVAL);
    11291129                ipc_answer_0(rid, EINVAL);
     
    11361136                return;
    11371137        }
    1138         if ((rc = async_data_write_finalize(callid, old, olen))) {
     1138        if ((rc = ipc_data_write_finalize(callid, old, olen))) {
    11391139                ipc_answer_0(rid, rc);
    11401140                free(old);
     
    11441144       
    11451145        /* Retrieve the new path. */
    1146         if (!async_data_write_receive(&callid, &nlen)) {
     1146        if (!ipc_data_write_receive(&callid, &nlen)) {
    11471147                ipc_answer_0(callid, EINVAL);
    11481148                ipc_answer_0(rid, EINVAL);
     
    11571157                return;
    11581158        }
    1159         if ((rc = async_data_write_finalize(callid, new, nlen))) {
     1159        if ((rc = ipc_data_write_finalize(callid, new, nlen))) {
    11601160                ipc_answer_0(rid, rc);
    11611161                free(old);
  • uspace/srv/vfs/vfs_register.c

    rf307f12 rc123609  
    122122         * VFS info structure from the client FS.
    123123         */
    124         if (!async_data_write_receive(&callid, &size)) {
     124        if (!ipc_data_write_receive(&callid, &size)) {
    125125                /*
    126126                 * The client doesn't obey the same protocol as we do.
     
    163163        fibril_mutex_initialize(&fs_info->phone_lock);
    164164               
    165         rc = async_data_write_finalize(callid, &fs_info->vfs_info, size);
     165        rc = ipc_data_write_finalize(callid, &fs_info->vfs_info, size);
    166166        if (rc != EOK) {
    167167                dprintf("Failed to deliver the VFS info into our AS, rc=%d.\n",
     
    229229         */
    230230
    231         if (!async_share_in_receive(&callid, &size)) {
     231        if (!ipc_share_in_receive(&callid, &size)) {
    232232                dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call));
    233233                list_remove(&fs_info->fs_link);
     
    257257         * Commit to read-only sharing the PLB with the client.
    258258         */
    259         (void) async_share_in_finalize(callid, plb,
     259        (void) ipc_share_in_finalize(callid, plb,
    260260            AS_AREA_READ | AS_AREA_CACHEABLE);
    261261
Note: See TracChangeset for help on using the changeset viewer.