Changeset 3115355 in mainline
- Timestamp:
- 2007-12-31T10:14:38Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 27d293a
- Parents:
- badbd888
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/ipc.h
rbadbd888 r3115355 175 175 176 176 /** Send data to another address space over IPC. 177 * - ARG1 - destination address space virtual address, may be overriden by the 178 * recipient 179 * - ARG2 - source address space virtual address 180 * - ARG3 - size of data to be copied, may be overriden by the recipient 177 * - ARG1 - source address space virtual address 178 * - ARG2 - size of data to be copied, may be overriden by the recipient 181 179 * 182 180 * on answer, the recipient must set: 183 181 * 184 182 * - ARG1 - final destination address space virtual address 185 * - ARG 3- final size of data to be copied183 * - ARG2 - final size of data to be copied 186 184 */ 187 185 #define IPC_M_DATA_WRITE 6 -
kernel/generic/src/ipc/sysipc.c
rbadbd888 r3115355 273 273 274 274 dst = IPC_GET_ARG1(answer->data); 275 size = IPC_GET_ARG 3(answer->data);276 max_size = IPC_GET_ARG 3(*olddata);275 size = IPC_GET_ARG2(answer->data); 276 max_size = IPC_GET_ARG2(*olddata); 277 277 278 278 if (size <= max_size) { … … 326 326 break; 327 327 case IPC_M_DATA_WRITE: 328 src = IPC_GET_ARG 2(call->data);329 size = IPC_GET_ARG 3(call->data);328 src = IPC_GET_ARG1(call->data); 329 size = IPC_GET_ARG2(call->data); 330 330 331 331 if ((size <= 0) || (size > DATA_XFER_LIMIT)) -
uspace/lib/libc/generic/ipc.c
rbadbd888 r3115355 736 736 int ipc_data_write_send(int phoneid, void *src, size_t size) 737 737 { 738 return ipc_call_sync_ 3_0(phoneid, IPC_M_DATA_WRITE, 0, (ipcarg_t) src,738 return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src, 739 739 (ipcarg_t) size); 740 740 } … … 749 749 * @param callid Storage where the hash of the IPC_M_DATA_WRITE call will 750 750 * be stored. 751 * @param dst Storage where the suggested destination address will752 * be stored. May be NULL.753 751 * @param size Storage where the suggested size will be stored. May be 754 752 * NULL … … 756 754 * @return Non-zero on success, zero on failure. 757 755 */ 758 int ipc_data_write_receive(ipc_callid_t *callid, void **dst,size_t *size)756 int ipc_data_write_receive(ipc_callid_t *callid, size_t *size) 759 757 { 760 758 ipc_call_t data; … … 765 763 if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE) 766 764 return 0; 767 if (dst)768 *dst = (void *) IPC_GET_ARG1(data);769 765 if (size) 770 *size = (size_t) IPC_GET_ARG 3(data);766 *size = (size_t) IPC_GET_ARG2(data); 771 767 return 1; 772 768 } … … 785 781 int ipc_data_write_deliver(ipc_callid_t callid, void *dst, size_t size) 786 782 { 787 return ipc_answer_ 3(callid, EOK, (ipcarg_t) dst, 0, (ipcarg_t) size);783 return ipc_answer_2(callid, EOK, (ipcarg_t) dst, (ipcarg_t) size); 788 784 } 789 785 -
uspace/lib/libc/include/ipc/ipc.h
rbadbd888 r3115355 267 267 extern int ipc_data_read_deliver(ipc_callid_t callid, void *src, size_t size); 268 268 extern int ipc_data_write_send(int phoneid, void *src, size_t size); 269 extern int ipc_data_write_receive(ipc_callid_t *callid, void **dst, 270 size_t *size); 269 extern int ipc_data_write_receive(ipc_callid_t *callid, size_t *size); 271 270 extern int ipc_data_write_deliver(ipc_callid_t callid, void *dst, size_t size); 272 271 -
uspace/srv/devmap/devmap.c
rbadbd888 r3115355 203 203 * Get driver name 204 204 */ 205 if (!ipc_data_write_receive(&callid, NULL,&name_size)) {205 if (!ipc_data_write_receive(&callid, &name_size)) { 206 206 printf("Unexpected request.\n"); 207 207 free(driver); … … 369 369 370 370 /* Get device name */ 371 if (!ipc_data_write_receive(&callid, NULL,&size)) {371 if (!ipc_data_write_receive(&callid, &size)) { 372 372 free(device); 373 373 printf("Cannot read device name.\n"); … … 490 490 * read the name itself until the buffer is allocated). 491 491 */ 492 if (!ipc_data_write_receive(&callid, NULL,&name_size)) {492 if (!ipc_data_write_receive(&callid, &name_size)) { 493 493 ipc_answer_0(callid, EREFUSED); 494 494 ipc_answer_0(iid, EREFUSED); -
uspace/srv/fs/tmpfs/tmpfs_ops.c
rbadbd888 r3115355 339 339 ipc_callid_t callid; 340 340 size_t len; 341 if (!ipc_data_write_receive(&callid, NULL,&len)) {341 if (!ipc_data_write_receive(&callid, &len)) { 342 342 ipc_answer_0(callid, EINVAL); 343 343 ipc_answer_0(rid, EINVAL); -
uspace/srv/vfs/vfs_mount.c
rbadbd888 r3115355 87 87 * system. 88 88 */ 89 if (!ipc_data_write_receive(&callid, NULL,&size)) {89 if (!ipc_data_write_receive(&callid, &size)) { 90 90 ipc_answer_0(callid, EINVAL); 91 91 ipc_answer_0(rid, EINVAL); … … 123 123 * Now, we want the client to send us the mount point. 124 124 */ 125 if (!ipc_data_write_receive(&callid, NULL,&size)) {125 if (!ipc_data_write_receive(&callid, &size)) { 126 126 ipc_answer_0(callid, EINVAL); 127 127 ipc_answer_0(rid, EINVAL); -
uspace/srv/vfs/vfs_open.c
rbadbd888 r3115355 62 62 ipc_callid_t callid; 63 63 64 if (!ipc_data_write_receive(&callid, NULL,&size)) {64 if (!ipc_data_write_receive(&callid, &size)) { 65 65 ipc_answer_0(callid, EINVAL); 66 66 ipc_answer_0(rid, EINVAL); -
uspace/srv/vfs/vfs_rdwr.c
rbadbd888 r3115355 74 74 res = ipc_data_read_receive(&callid, NULL); 75 75 else 76 res = ipc_data_write_receive(&callid, NULL , NULL);76 res = ipc_data_write_receive(&callid, NULL); 77 77 if (!res) { 78 78 ipc_answer_0(callid, EINVAL); -
uspace/srv/vfs/vfs_register.c
rbadbd888 r3115355 165 165 * VFS info structure from the client FS. 166 166 */ 167 if (!ipc_data_write_receive(&callid, NULL,&size)) {167 if (!ipc_data_write_receive(&callid, &size)) { 168 168 /* 169 169 * The client doesn't obey the same protocol as we do.
Note:
See TracChangeset
for help on using the changeset viewer.