Changeset 0da4e41 in mainline
- Timestamp:
- 2009-10-11T16:11:22Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba8f8cb
- Parents:
- bbb01b98
- Location:
- uspace
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
rbbb01b98 r0da4e41 74 74 } 75 75 76 int res = ipc_share_in_start_1_0(PHONE_NS, (void *) klog,76 int res = async_share_in_start_1_0(PHONE_NS, (void *) klog, 77 77 klog_size, SERVICE_MEM_KLOG); 78 78 if (res != EOK) { -
uspace/lib/libblock/libblock.c
rbbb01b98 r0da4e41 168 168 } 169 169 170 rc = ipc_share_out_start(dev_phone, comm_area,170 rc = async_share_out_start(dev_phone, comm_area, 171 171 AS_AREA_READ | AS_AREA_WRITE); 172 172 if (rc != EOK) { -
uspace/lib/libc/generic/async.c
rbbb01b98 r0da4e41 1087 1087 } 1088 1088 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 1089 1333 /** @} 1090 1334 */ -
uspace/lib/libc/generic/devmap.c
rbbb01b98 r0da4e41 105 105 aid_t req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer); 106 106 107 ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1);107 ipcarg_t retval = async_data_write_start(phone, name, str_size(name) + 1); 108 108 109 109 if (retval != EOK) { … … 143 143 &answer); 144 144 145 ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1);145 ipcarg_t retval = async_data_write_start(phone, name, str_size(name) + 1); 146 146 147 147 if (retval != EOK) { … … 180 180 &answer); 181 181 182 ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1);182 ipcarg_t retval = async_data_write_start(phone, name, str_size(name) + 1); 183 183 184 184 if (retval != EOK) { … … 271 271 aid_t req = async_send_0(phone, DEVMAP_DEVICE_GET_DEVICES, &answer); 272 272 273 ipcarg_t retval = ipc_data_read_start(phone, data, count * sizeof(dev_desc_t));273 ipcarg_t retval = async_data_read_start(phone, data, count * sizeof(dev_desc_t)); 274 274 275 275 if (retval != EOK) { -
uspace/lib/libc/generic/loader.c
rbbb01b98 r0da4e41 90 90 ipc_call_t answer; 91 91 aid_t req = async_send_0(ldr->phone_id, LOADER_GET_TASKID, &answer); 92 int rc = ipc_data_read_start(ldr->phone_id, task_id, sizeof(task_id_t));92 int rc = async_data_read_start(ldr->phone_id, task_id, sizeof(task_id_t)); 93 93 if (rc != EOK) { 94 94 async_wait_for(req, NULL); … … 123 123 ipc_call_t answer; 124 124 aid_t req = async_send_0(ldr->phone_id, LOADER_SET_PATHNAME, &answer); 125 int rc = ipc_data_write_start(ldr->phone_id, (void *) pa, pa_len);125 int rc = async_data_write_start(ldr->phone_id, (void *) pa, pa_len); 126 126 if (rc != EOK) { 127 127 async_wait_for(req, NULL); … … 178 178 ipc_call_t answer; 179 179 aid_t req = async_send_0(ldr->phone_id, LOADER_SET_ARGS, &answer); 180 ipcarg_t rc = ipc_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size);180 ipcarg_t rc = async_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size); 181 181 if (rc != EOK) { 182 182 async_wait_for(req, NULL); … … 232 232 ipc_call_t answer; 233 233 aid_t req = async_send_0(ldr->phone_id, LOADER_SET_FILES, &answer); 234 ipcarg_t rc = ipc_data_write_start(ldr->phone_id, (void *) files_buf,234 ipcarg_t rc = async_data_write_start(ldr->phone_id, (void *) files_buf, 235 235 count * sizeof(fdi_node_t)); 236 236 if (rc != EOK) { -
uspace/lib/libc/generic/vfs/vfs.c
rbbb01b98 r0da4e41 140 140 141 141 req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL); 142 rc = ipc_data_write_start(vfs_phone, (void *) mpa, mpa_size);142 rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size); 143 143 if (rc != EOK) { 144 144 async_wait_for(req, &rc_orig); … … 152 152 } 153 153 154 rc = ipc_data_write_start(vfs_phone, (void *) opts, str_size(opts));154 rc = async_data_write_start(vfs_phone, (void *) opts, str_size(opts)); 155 155 if (rc != EOK) { 156 156 async_wait_for(req, &rc_orig); … … 164 164 } 165 165 166 rc = ipc_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name));166 rc = async_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name)); 167 167 if (rc != EOK) { 168 168 async_wait_for(req, &rc_orig); … … 213 213 214 214 req = async_send_3(vfs_phone, VFS_IN_OPEN, lflag, oflag, 0, &answer); 215 rc = ipc_data_write_start(vfs_phone, pa, pa_size);215 rc = async_data_write_start(vfs_phone, pa, pa_size); 216 216 if (rc != EOK) { 217 217 ipcarg_t rc_orig; … … 290 290 291 291 req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer); 292 rc = ipc_data_read_start(vfs_phone, (void *)buf, nbyte);292 rc = async_data_read_start(vfs_phone, (void *)buf, nbyte); 293 293 if (rc != EOK) { 294 294 ipcarg_t rc_orig; … … 322 322 323 323 req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer); 324 rc = ipc_data_write_start(vfs_phone, (void *)buf, nbyte);324 rc = async_data_write_start(vfs_phone, (void *)buf, nbyte); 325 325 if (rc != EOK) { 326 326 ipcarg_t rc_orig; … … 402 402 403 403 req = async_send_1(vfs_phone, VFS_IN_FSTAT, fildes, NULL); 404 rc = ipc_data_read_start(vfs_phone, (void *)stat, sizeof(struct stat));404 rc = async_data_read_start(vfs_phone, (void *)stat, sizeof(struct stat)); 405 405 if (rc != EOK) { 406 406 ipcarg_t rc_orig; … … 437 437 438 438 req = async_send_0(vfs_phone, VFS_IN_STAT, NULL); 439 rc = ipc_data_write_start(vfs_phone, pa, pa_size);439 rc = async_data_write_start(vfs_phone, pa, pa_size); 440 440 if (rc != EOK) { 441 441 async_wait_for(req, &rc_orig); … … 448 448 return (int) rc_orig; 449 449 } 450 rc = ipc_data_read_start(vfs_phone, stat, sizeof(struct stat));450 rc = async_data_read_start(vfs_phone, stat, sizeof(struct stat)); 451 451 if (rc != EOK) { 452 452 async_wait_for(req, &rc_orig); … … 514 514 515 515 req = async_send_1(vfs_phone, VFS_IN_MKDIR, mode, NULL); 516 rc = ipc_data_write_start(vfs_phone, pa, pa_size);516 rc = async_data_write_start(vfs_phone, pa, pa_size); 517 517 if (rc != EOK) { 518 518 ipcarg_t rc_orig; … … 549 549 550 550 req = async_send_0(vfs_phone, VFS_IN_UNLINK, NULL); 551 rc = ipc_data_write_start(vfs_phone, pa, pa_size);551 rc = async_data_write_start(vfs_phone, pa, pa_size); 552 552 if (rc != EOK) { 553 553 ipcarg_t rc_orig; … … 602 602 603 603 req = async_send_0(vfs_phone, VFS_IN_RENAME, NULL); 604 rc = ipc_data_write_start(vfs_phone, olda, olda_size);604 rc = async_data_write_start(vfs_phone, olda, olda_size); 605 605 if (rc != EOK) { 606 606 async_wait_for(req, &rc_orig); … … 614 614 return (int) rc_orig; 615 615 } 616 rc = ipc_data_write_start(vfs_phone, newa, newa_size);616 rc = async_data_write_start(vfs_phone, newa, newa_size); 617 617 if (rc != EOK) { 618 618 async_wait_for(req, &rc_orig); -
uspace/lib/libc/include/async.h
rbbb01b98 r0da4e41 259 259 } 260 260 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 261 286 #endif 262 287 -
uspace/lib/libfs/libfs.c
rbbb01b98 r0da4e41 91 91 * Send our VFS info structure to VFS. 92 92 */ 93 int rc = ipc_data_write_start(vfs_phone, info, sizeof(*info));93 int rc = async_data_write_start(vfs_phone, info, sizeof(*info)); 94 94 if (rc != EOK) { 95 95 async_wait_for(req, NULL); … … 114 114 * Request sharing the Path Lookup Buffer with VFS. 115 115 */ 116 rc = ipc_share_in_start_0_0(vfs_phone, reg->plb_ro, PLB_SIZE);116 rc = async_share_in_start_0_0(vfs_phone, reg->plb_ro, PLB_SIZE); 117 117 if (rc) { 118 118 async_wait_for(req, NULL); … … 169 169 ipc_answer_0(callid, EOK); /* acknowledge the mountee_phone */ 170 170 171 res = ipc_data_write_receive(&callid, NULL);171 res = async_data_write_receive(&callid, NULL); 172 172 if (!res) { 173 173 ipc_hangup(mountee_phone); … … 486 486 ipc_callid_t callid; 487 487 size_t size; 488 if (! ipc_data_read_receive(&callid, &size) ||488 if (!async_data_read_receive(&callid, &size) || 489 489 size != sizeof(struct stat)) { 490 490 ipc_answer_0(callid, EINVAL); … … 503 503 stat.size = ops->size_get(fn); 504 504 505 ipc_data_read_finalize(callid, &stat, sizeof(struct stat));505 async_data_read_finalize(callid, &stat, sizeof(struct stat)); 506 506 ipc_answer_0(rid, EOK); 507 507 } -
uspace/srv/bd/ata_bd/ata_bd.c
rbbb01b98 r0da4e41 252 252 ipc_answer_0(iid, EOK); 253 253 254 if (! ipc_share_out_receive(&callid, &comm_size, &flags)) {254 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 255 255 ipc_answer_0(callid, EHANGUP); 256 256 return; … … 263 263 } 264 264 265 (void) ipc_share_out_finalize(callid, fs_va);265 (void) async_share_out_finalize(callid, fs_va); 266 266 267 267 while (1) { -
uspace/srv/bd/file_bd/file_bd.c
rbbb01b98 r0da4e41 130 130 ipc_answer_0(iid, EOK); 131 131 132 if (! ipc_share_out_receive(&callid, &comm_size, &flags)) {132 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 133 133 ipc_answer_0(callid, EHANGUP); 134 134 return; … … 141 141 } 142 142 143 (void) ipc_share_out_finalize(callid, fs_va);143 (void) async_share_out_finalize(callid, fs_va); 144 144 145 145 while (1) { -
uspace/srv/bd/gxe_bd/gxe_bd.c
rbbb01b98 r0da4e41 185 185 ipc_answer_0(iid, EOK); 186 186 187 if (! ipc_share_out_receive(&callid, &comm_size, &flags)) {187 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 188 188 ipc_answer_0(callid, EHANGUP); 189 189 return; … … 201 201 } 202 202 203 (void) ipc_share_out_finalize(callid, fs_va);203 (void) async_share_out_finalize(callid, fs_va); 204 204 205 205 while (1) { -
uspace/srv/bd/rd/rd.c
rbbb01b98 r0da4e41 102 102 */ 103 103 int flags; 104 if ( ipc_share_out_receive(&callid, &comm_size, &flags)) {104 if (async_share_out_receive(&callid, &comm_size, &flags)) { 105 105 fs_va = as_get_mappable_page(comm_size); 106 106 if (fs_va) { 107 (void) ipc_share_out_finalize(callid, fs_va);107 (void) async_share_out_finalize(callid, fs_va); 108 108 } else { 109 109 ipc_answer_0(callid, EHANGUP); -
uspace/srv/console/console.c
rbbb01b98 r0da4e41 429 429 ipc_callid_t callid; 430 430 size_t size; 431 if (! ipc_data_write_receive(&callid, &size)) {431 if (!async_data_write_receive(&callid, &size)) { 432 432 ipc_answer_0(callid, EINVAL); 433 433 ipc_answer_0(rid, EINVAL); … … 442 442 } 443 443 444 (void) ipc_data_write_finalize(callid, buf, size);444 (void) async_data_write_finalize(callid, buf, size); 445 445 446 446 async_serialize_start(); … … 464 464 ipc_callid_t callid; 465 465 size_t size; 466 if (! ipc_data_read_receive(&callid, &size)) {466 if (!async_data_read_receive(&callid, &size)) { 467 467 ipc_answer_0(callid, EINVAL); 468 468 ipc_answer_0(rid, EINVAL); … … 489 489 490 490 if (pos == size) { 491 (void) ipc_data_read_finalize(callid, buf, size);491 (void) async_data_read_finalize(callid, buf, size); 492 492 ipc_answer_1(rid, EOK, size); 493 493 free(buf); … … 713 713 714 714 if (interbuffer) { 715 if ( ipc_share_out_start(fb_info.phone, interbuffer,715 if (async_share_out_start(fb_info.phone, interbuffer, 716 716 AS_AREA_READ) != EOK) { 717 717 as_area_destroy(interbuffer); -
uspace/srv/console/gcons.c
rbbb01b98 r0da4e41 339 339 goto exit; 340 340 341 rc = ipc_share_out_start(fbphone, shm, PROTO_READ);341 rc = async_share_out_start(fbphone, shm, PROTO_READ); 342 342 if (rc) 343 343 goto drop; … … 409 409 goto exit; 410 410 411 rc = ipc_share_out_start(fbphone, shm, PROTO_READ);411 rc = async_share_out_start(fbphone, shm, PROTO_READ); 412 412 if (rc) 413 413 goto drop; -
uspace/srv/devmap/devmap.c
rbbb01b98 r0da4e41 213 213 ipc_callid_t callid; 214 214 size_t name_size; 215 if (! ipc_data_write_receive(&callid, &name_size)) {215 if (!async_data_write_receive(&callid, &name_size)) { 216 216 free(driver); 217 217 ipc_answer_0(callid, EREFUSED); … … 241 241 * Send confirmation to sender and get data into buffer. 242 242 */ 243 if ( ipc_data_write_finalize(callid, driver->name, name_size) != EOK) {243 if (async_data_write_finalize(callid, driver->name, name_size) != EOK) { 244 244 free(driver->name); 245 245 free(driver); … … 358 358 ipc_callid_t callid; 359 359 size_t size; 360 if (! ipc_data_write_receive(&callid, &size)) {360 if (!async_data_write_receive(&callid, &size)) { 361 361 free(device); 362 362 ipc_answer_0(iid, EREFUSED); … … 381 381 } 382 382 383 ipc_data_write_finalize(callid, device->name, size);383 async_data_write_finalize(callid, device->name, size); 384 384 device->name[size] = 0; 385 385 … … 466 466 ipc_callid_t callid; 467 467 size_t size; 468 if (! ipc_data_write_receive(&callid, &size)) {468 if (!async_data_write_receive(&callid, &size)) { 469 469 ipc_answer_0(callid, EREFUSED); 470 470 ipc_answer_0(iid, EREFUSED); … … 491 491 * Send confirmation to sender and get data into buffer. 492 492 */ 493 ipcarg_t retval = ipc_data_write_finalize(callid, name, size);493 ipcarg_t retval = async_data_write_finalize(callid, name, size); 494 494 if (retval != EOK) { 495 495 ipc_answer_0(iid, EREFUSED); … … 553 553 * size_t name_size = str_size(device->name); 554 554 * 555 * int rc = ipc_data_write_send(phone, device->name, name_size);555 * int rc = async_data_write_send(phone, device->name, name_size); 556 556 * if (rc != EOK) { 557 557 * async_wait_for(req, NULL); … … 576 576 ipc_callid_t callid; 577 577 size_t size; 578 if (! ipc_data_read_receive(&callid, &size)) {578 if (!async_data_read_receive(&callid, &size)) { 579 579 ipc_answer_0(callid, EREFUSED); 580 580 ipc_answer_0(iid, EREFUSED); … … 608 608 } 609 609 610 ipcarg_t retval = ipc_data_read_finalize(callid, desc, pos * sizeof(dev_desc_t));610 ipcarg_t retval = async_data_read_finalize(callid, desc, pos * sizeof(dev_desc_t)); 611 611 if (retval != EOK) { 612 612 ipc_answer_0(iid, EREFUSED); -
uspace/srv/fs/devfs/devfs_ops.c
rbbb01b98 r0da4e41 108 108 ipc_callid_t callid; 109 109 size_t size; 110 if (! ipc_data_write_receive(&callid, &size)) {110 if (!async_data_write_receive(&callid, &size)) { 111 111 ipc_answer_0(callid, EINVAL); 112 112 ipc_answer_0(rid, EINVAL); … … 121 121 } 122 122 123 ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);123 ipcarg_t retval = async_data_write_finalize(callid, opts, size); 124 124 if (retval != EOK) { 125 125 ipc_answer_0(rid, retval); … … 286 286 ipc_callid_t callid; 287 287 size_t size; 288 if (! ipc_data_read_receive(&callid, &size) ||288 if (!async_data_read_receive(&callid, &size) || 289 289 size != sizeof(struct stat)) { 290 290 ipc_answer_0(callid, EINVAL); … … 315 315 } 316 316 317 ipc_data_read_finalize(callid, &stat, sizeof(struct stat));317 async_data_read_finalize(callid, &stat, sizeof(struct stat)); 318 318 ipc_answer_0(rid, EOK); 319 319 } … … 340 340 341 341 ipc_callid_t callid; 342 if (! ipc_data_read_receive(&callid, NULL)) {342 if (!async_data_read_receive(&callid, NULL)) { 343 343 fibril_mutex_unlock(&devices_mutex); 344 344 ipc_answer_0(callid, EINVAL); … … 367 367 ipc_callid_t callid; 368 368 size_t size; 369 if (! ipc_data_read_receive(&callid, &size)) {369 if (!async_data_read_receive(&callid, &size)) { 370 370 ipc_answer_0(callid, EINVAL); 371 371 ipc_answer_0(rid, EINVAL); … … 384 384 385 385 if (pos < max) { 386 ipc_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);386 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 387 387 } else { 388 388 ipc_answer_0(callid, ENOENT); … … 418 418 419 419 ipc_callid_t callid; 420 if (! ipc_data_write_receive(&callid, NULL)) {420 if (!async_data_write_receive(&callid, NULL)) { 421 421 fibril_mutex_unlock(&devices_mutex); 422 422 ipc_answer_0(callid, EINVAL); -
uspace/srv/fs/fat/fat_ops.c
rbbb01b98 r0da4e41 897 897 ipc_callid_t callid; 898 898 size_t size; 899 if (! ipc_data_write_receive(&callid, &size)) {899 if (!async_data_write_receive(&callid, &size)) { 900 900 ipc_answer_0(callid, EINVAL); 901 901 ipc_answer_0(rid, EINVAL); … … 908 908 return; 909 909 } 910 ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);910 ipcarg_t retval = async_data_write_finalize(callid, opts, size); 911 911 if (retval != EOK) { 912 912 ipc_answer_0(rid, retval); … … 1047 1047 ipc_callid_t callid; 1048 1048 size_t len; 1049 if (! ipc_data_read_receive(&callid, &len)) {1049 if (!async_data_read_receive(&callid, &len)) { 1050 1050 fat_node_put(fn); 1051 1051 ipc_answer_0(callid, EINVAL); … … 1066 1066 /* reading beyond the EOF */ 1067 1067 bytes = 0; 1068 (void) ipc_data_read_finalize(callid, NULL, 0);1068 (void) async_data_read_finalize(callid, NULL, 0); 1069 1069 } else { 1070 1070 bytes = min(len, bps - pos % bps); … … 1073 1073 BLOCK_FLAGS_NONE); 1074 1074 assert(rc == EOK); 1075 (void) ipc_data_read_finalize(callid, b->data + pos % bps,1075 (void) async_data_read_finalize(callid, b->data + pos % bps, 1076 1076 bytes); 1077 1077 rc = block_put(b); … … 1131 1131 return; 1132 1132 hit: 1133 (void) ipc_data_read_finalize(callid, name, str_size(name) + 1);1133 (void) async_data_read_finalize(callid, name, str_size(name) + 1); 1134 1134 bytes = (pos - spos) + 1; 1135 1135 } … … 1169 1169 ipc_callid_t callid; 1170 1170 size_t len; 1171 if (! ipc_data_write_receive(&callid, &len)) {1171 if (!async_data_write_receive(&callid, &len)) { 1172 1172 fat_node_put(fn); 1173 1173 ipc_answer_0(callid, EINVAL); … … 1204 1204 rc = fat_block_get(&b, bs, nodep, pos / bps, flags); 1205 1205 assert(rc == EOK); 1206 (void) ipc_data_write_finalize(callid, b->data + pos % bps,1206 (void) async_data_write_finalize(callid, b->data + pos % bps, 1207 1207 bytes); 1208 1208 b->dirty = true; /* need to sync block */ … … 1241 1241 flags); 1242 1242 assert(rc == EOK); 1243 (void) ipc_data_write_finalize(callid, b->data + pos % bps,1243 (void) async_data_write_finalize(callid, b->data + pos % bps, 1244 1244 bytes); 1245 1245 b->dirty = true; /* need to sync block */ -
uspace/srv/fs/tmpfs/tmpfs_ops.c
rbbb01b98 r0da4e41 389 389 ipc_callid_t callid; 390 390 size_t size; 391 if (! ipc_data_write_receive(&callid, &size)) {391 if (!async_data_write_receive(&callid, &size)) { 392 392 ipc_answer_0(callid, EINVAL); 393 393 ipc_answer_0(rid, EINVAL); … … 400 400 return; 401 401 } 402 ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);402 ipcarg_t retval = async_data_write_finalize(callid, opts, size); 403 403 if (retval != EOK) { 404 404 ipc_answer_0(rid, retval); … … 467 467 ipc_callid_t callid; 468 468 size_t size; 469 if (! ipc_data_read_receive(&callid, &size)) {469 if (!async_data_read_receive(&callid, &size)) { 470 470 ipc_answer_0(callid, EINVAL); 471 471 ipc_answer_0(rid, EINVAL); … … 476 476 if (nodep->type == TMPFS_FILE) { 477 477 bytes = max(0, min(nodep->size - pos, size)); 478 (void) ipc_data_read_finalize(callid, nodep->data + pos,478 (void) async_data_read_finalize(callid, nodep->data + pos, 479 479 bytes); 480 480 } else { … … 503 503 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); 504 504 505 (void) ipc_data_read_finalize(callid, dentryp->name,505 (void) async_data_read_finalize(callid, dentryp->name, 506 506 str_size(dentryp->name) + 1); 507 507 bytes = 1; … … 541 541 ipc_callid_t callid; 542 542 size_t size; 543 if (! ipc_data_write_receive(&callid, &size)) {543 if (!async_data_write_receive(&callid, &size)) { 544 544 ipc_answer_0(callid, EINVAL); 545 545 ipc_answer_0(rid, EINVAL); … … 552 552 if (pos + size <= nodep->size) { 553 553 /* The file size is not changing. */ 554 (void) ipc_data_write_finalize(callid, nodep->data + pos, size);554 (void) async_data_write_finalize(callid, nodep->data + pos, size); 555 555 ipc_answer_2(rid, EOK, size, nodep->size); 556 556 return; … … 574 574 nodep->size += delta; 575 575 nodep->data = newdata; 576 (void) ipc_data_write_finalize(callid, nodep->data + pos, size);576 (void) async_data_write_finalize(callid, nodep->data + pos, size); 577 577 ipc_answer_2(rid, EOK, size, nodep->size); 578 578 } -
uspace/srv/loader/main.c
rbbb01b98 r0da4e41 102 102 task_id = task_get_id(); 103 103 104 if (! ipc_data_read_receive(&callid, &len)) {104 if (!async_data_read_receive(&callid, &len)) { 105 105 ipc_answer_0(callid, EINVAL); 106 106 ipc_answer_0(rid, EINVAL); … … 111 111 len = sizeof(task_id); 112 112 113 ipc_data_read_finalize(callid, &task_id, len);113 async_data_read_finalize(callid, &task_id, len); 114 114 ipc_answer_0(rid, EOK); 115 115 } … … 127 127 char *name_buf; 128 128 129 if (! ipc_data_write_receive(&callid, &len)) {129 if (!async_data_write_receive(&callid, &len)) { 130 130 ipc_answer_0(callid, EINVAL); 131 131 ipc_answer_0(rid, EINVAL); … … 140 140 } 141 141 142 ipc_data_write_finalize(callid, name_buf, len);142 async_data_write_finalize(callid, name_buf, len); 143 143 ipc_answer_0(rid, EOK); 144 144 … … 164 164 int n; 165 165 166 if (! ipc_data_write_receive(&callid, &buf_size)) {166 if (!async_data_write_receive(&callid, &buf_size)) { 167 167 ipc_answer_0(callid, EINVAL); 168 168 ipc_answer_0(rid, EINVAL); … … 187 187 } 188 188 189 ipc_data_write_finalize(callid, arg_buf, buf_size);189 async_data_write_finalize(callid, arg_buf, buf_size); 190 190 191 191 arg_buf[buf_size] = '\0'; … … 239 239 ipc_callid_t callid; 240 240 size_t buf_size; 241 if (! ipc_data_write_receive(&callid, &buf_size)) {241 if (!async_data_write_receive(&callid, &buf_size)) { 242 242 ipc_answer_0(callid, EINVAL); 243 243 ipc_answer_0(rid, EINVAL); … … 268 268 } 269 269 270 ipc_data_write_finalize(callid, fil_buf, buf_size);270 async_data_write_finalize(callid, fil_buf, buf_size); 271 271 272 272 int count = buf_size / sizeof(fdi_node_t); -
uspace/srv/part/mbr_part/mbr_part.c
rbbb01b98 r0da4e41 419 419 ipc_answer_0(iid, EOK); 420 420 421 if (! ipc_share_out_receive(&callid, &comm_size, &flags)) {421 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 422 422 ipc_answer_0(callid, EHANGUP); 423 423 return; … … 430 430 } 431 431 432 (void) ipc_share_out_finalize(callid, fs_va);432 (void) async_share_out_finalize(callid, fs_va); 433 433 434 434 while (1) { -
uspace/srv/vfs/vfs_ops.c
rbbb01b98 r0da4e41 125 125 (ipcarg_t) dev_handle, &answer); 126 126 /* send the mount options */ 127 rc = ipc_data_write_start(phone, (void *)opts,127 rc = async_data_write_start(phone, (void *)opts, 128 128 str_size(opts)); 129 129 if (rc != EOK) { … … 207 207 208 208 /* send the mount options */ 209 rc = ipc_data_write_start(phone, (void *)opts, str_size(opts));209 rc = async_data_write_start(phone, (void *)opts, str_size(opts)); 210 210 if (rc != EOK) { 211 211 async_wait_for(msg, NULL); … … 268 268 ipc_callid_t callid; 269 269 size_t size; 270 if (! ipc_data_write_receive(&callid, &size)) {270 if (!async_data_write_receive(&callid, &size)) { 271 271 ipc_answer_0(callid, EINVAL); 272 272 ipc_answer_0(rid, EINVAL); … … 290 290 291 291 /* Deliver the mount point. */ 292 ipcarg_t retval = ipc_data_write_finalize(callid, mp, size);292 ipcarg_t retval = async_data_write_finalize(callid, mp, size); 293 293 if (retval != EOK) { 294 294 ipc_answer_0(rid, retval); … … 299 299 300 300 /* Now we expect to receive the mount options. */ 301 if (! ipc_data_write_receive(&callid, &size)) {301 if (!async_data_write_receive(&callid, &size)) { 302 302 ipc_answer_0(callid, EINVAL); 303 303 ipc_answer_0(rid, EINVAL); … … 324 324 325 325 /* Deliver the mount options. */ 326 retval = ipc_data_write_finalize(callid, opts, size);326 retval = async_data_write_finalize(callid, opts, size); 327 327 if (retval != EOK) { 328 328 ipc_answer_0(rid, retval); … … 337 337 * system. 338 338 */ 339 if (! ipc_data_write_receive(&callid, &size)) {339 if (!async_data_write_receive(&callid, &size)) { 340 340 ipc_answer_0(callid, EINVAL); 341 341 ipc_answer_0(rid, EINVAL); … … 370 370 371 371 /* Deliver the file system name. */ 372 retval = ipc_data_write_finalize(callid, fs_name, size);372 retval = async_data_write_finalize(callid, fs_name, size); 373 373 if (retval != EOK) { 374 374 ipc_answer_0(rid, retval); … … 469 469 470 470 ipc_callid_t callid; 471 if (! ipc_data_write_receive(&callid, &len)) {471 if (!async_data_write_receive(&callid, &len)) { 472 472 ipc_answer_0(callid, EINVAL); 473 473 ipc_answer_0(rid, EINVAL); … … 483 483 484 484 int rc; 485 if ((rc = ipc_data_write_finalize(callid, path, len))) {485 if ((rc = async_data_write_finalize(callid, path, len))) { 486 486 ipc_answer_0(rid, rc); 487 487 free(path); … … 747 747 int res; 748 748 if (read) 749 res = ipc_data_read_receive(&callid, NULL);749 res = async_data_read_receive(&callid, NULL); 750 750 else 751 res = ipc_data_write_receive(&callid, NULL);751 res = async_data_write_receive(&callid, NULL); 752 752 if (!res) { 753 753 ipc_answer_0(callid, EINVAL); … … 943 943 944 944 ipc_callid_t callid; 945 if (! ipc_data_read_receive(&callid, NULL)) {945 if (!async_data_read_receive(&callid, NULL)) { 946 946 ipc_answer_0(callid, EINVAL); 947 947 ipc_answer_0(rid, EINVAL); … … 969 969 ipc_callid_t callid; 970 970 971 if (! ipc_data_write_receive(&callid, &len)) {971 if (!async_data_write_receive(&callid, &len)) { 972 972 ipc_answer_0(callid, EINVAL); 973 973 ipc_answer_0(rid, EINVAL); … … 981 981 } 982 982 int rc; 983 if ((rc = ipc_data_write_finalize(callid, path, len))) {983 if ((rc = async_data_write_finalize(callid, path, len))) { 984 984 ipc_answer_0(rid, rc); 985 985 free(path); … … 988 988 path[len] = '\0'; 989 989 990 if (! ipc_data_read_receive(&callid, NULL)) {990 if (!async_data_read_receive(&callid, NULL)) { 991 991 free(path); 992 992 ipc_answer_0(callid, EINVAL); … … 1037 1037 ipc_callid_t callid; 1038 1038 1039 if (! ipc_data_write_receive(&callid, &len)) {1039 if (!async_data_write_receive(&callid, &len)) { 1040 1040 ipc_answer_0(callid, EINVAL); 1041 1041 ipc_answer_0(rid, EINVAL); … … 1049 1049 } 1050 1050 int rc; 1051 if ((rc = ipc_data_write_finalize(callid, path, len))) {1051 if ((rc = async_data_write_finalize(callid, path, len))) { 1052 1052 ipc_answer_0(rid, rc); 1053 1053 free(path); … … 1074 1074 ipc_callid_t callid; 1075 1075 1076 if (! ipc_data_write_receive(&callid, &len)) {1076 if (!async_data_write_receive(&callid, &len)) { 1077 1077 ipc_answer_0(callid, EINVAL); 1078 1078 ipc_answer_0(rid, EINVAL); … … 1086 1086 } 1087 1087 int rc; 1088 if ((rc = ipc_data_write_finalize(callid, path, len))) {1088 if ((rc = async_data_write_finalize(callid, path, len))) { 1089 1089 ipc_answer_0(rid, rc); 1090 1090 free(path); … … 1125 1125 1126 1126 /* Retrieve the old path. */ 1127 if (! ipc_data_write_receive(&callid, &olen)) {1127 if (!async_data_write_receive(&callid, &olen)) { 1128 1128 ipc_answer_0(callid, EINVAL); 1129 1129 ipc_answer_0(rid, EINVAL); … … 1136 1136 return; 1137 1137 } 1138 if ((rc = ipc_data_write_finalize(callid, old, olen))) {1138 if ((rc = async_data_write_finalize(callid, old, olen))) { 1139 1139 ipc_answer_0(rid, rc); 1140 1140 free(old); … … 1144 1144 1145 1145 /* Retrieve the new path. */ 1146 if (! ipc_data_write_receive(&callid, &nlen)) {1146 if (!async_data_write_receive(&callid, &nlen)) { 1147 1147 ipc_answer_0(callid, EINVAL); 1148 1148 ipc_answer_0(rid, EINVAL); … … 1157 1157 return; 1158 1158 } 1159 if ((rc = ipc_data_write_finalize(callid, new, nlen))) {1159 if ((rc = async_data_write_finalize(callid, new, nlen))) { 1160 1160 ipc_answer_0(rid, rc); 1161 1161 free(old); -
uspace/srv/vfs/vfs_register.c
rbbb01b98 r0da4e41 122 122 * VFS info structure from the client FS. 123 123 */ 124 if (! ipc_data_write_receive(&callid, &size)) {124 if (!async_data_write_receive(&callid, &size)) { 125 125 /* 126 126 * The client doesn't obey the same protocol as we do. … … 163 163 fibril_mutex_initialize(&fs_info->phone_lock); 164 164 165 rc = ipc_data_write_finalize(callid, &fs_info->vfs_info, size);165 rc = async_data_write_finalize(callid, &fs_info->vfs_info, size); 166 166 if (rc != EOK) { 167 167 dprintf("Failed to deliver the VFS info into our AS, rc=%d.\n", … … 229 229 */ 230 230 231 if (! ipc_share_in_receive(&callid, &size)) {231 if (!async_share_in_receive(&callid, &size)) { 232 232 dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call)); 233 233 list_remove(&fs_info->fs_link); … … 257 257 * Commit to read-only sharing the PLB with the client. 258 258 */ 259 (void) ipc_share_in_finalize(callid, plb,259 (void) async_share_in_finalize(callid, plb, 260 260 AS_AREA_READ | AS_AREA_CACHEABLE); 261 261
Note:
See TracChangeset
for help on using the changeset viewer.