Changes in kernel/generic/src/ipc/ops/dataread.c [aafed15:5a5269d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/dataread.c
raafed15 r5a5269d 43 43 static errno_t request_preprocess(call_t *call, phone_t *phone) 44 44 { 45 size_t size = IPC_GET_ARG2(call->data);45 size_t size = ipc_get_arg2(&call->data); 46 46 47 47 if (size > DATA_XFER_LIMIT) { 48 int flags = IPC_GET_ARG3(call->data);48 int flags = ipc_get_arg3(&call->data); 49 49 50 50 if (flags & IPC_XF_RESTRICT) 51 IPC_SET_ARG2(call->data, DATA_XFER_LIMIT);51 ipc_set_arg2(&call->data, DATA_XFER_LIMIT); 52 52 else 53 53 return ELIMIT; … … 61 61 assert(!answer->buffer); 62 62 63 if (! IPC_GET_RETVAL(answer->data)) {63 if (!ipc_get_retval(&answer->data)) { 64 64 /* The recipient agreed to send data. */ 65 u intptr_t src = IPC_GET_ARG1(answer->data);66 u intptr_t dst = IPC_GET_ARG1(*olddata);67 size_t max_size = IPC_GET_ARG2(*olddata);68 size_t size = IPC_GET_ARG2(answer->data);65 uspace_addr_t src = ipc_get_arg1(&answer->data); 66 uspace_addr_t dst = ipc_get_arg1(olddata); 67 size_t max_size = ipc_get_arg2(olddata); 68 size_t size = ipc_get_arg2(&answer->data); 69 69 70 70 if (size && size <= max_size) { … … 73 73 * information is not lost. 74 74 */ 75 IPC_SET_ARG1(answer->data, dst);75 ipc_set_arg1(&answer->data, dst); 76 76 77 77 answer->buffer = malloc(size); 78 78 if (!answer->buffer) { 79 IPC_SET_RETVAL(answer->data, ENOMEM);79 ipc_set_retval(&answer->data, ENOMEM); 80 80 return EOK; 81 81 } 82 82 errno_t rc = copy_from_uspace(answer->buffer, 83 (void *)src, size);83 src, size); 84 84 if (rc) { 85 IPC_SET_RETVAL(answer->data, rc);85 ipc_set_retval(&answer->data, rc); 86 86 /* 87 87 * answer->buffer will be cleaned up in … … 91 91 } 92 92 } else if (!size) { 93 IPC_SET_RETVAL(answer->data, EOK);93 ipc_set_retval(&answer->data, EOK); 94 94 } else { 95 IPC_SET_RETVAL(answer->data, ELIMIT);95 ipc_set_retval(&answer->data, ELIMIT); 96 96 } 97 97 } … … 103 103 { 104 104 if (answer->buffer) { 105 u intptr_t dst = IPC_GET_ARG1(answer->data);106 size_t size = IPC_GET_ARG2(answer->data);105 uspace_addr_t dst = ipc_get_arg1(&answer->data); 106 size_t size = ipc_get_arg2(&answer->data); 107 107 errno_t rc; 108 108 109 rc = copy_to_uspace( (void *)dst, answer->buffer, size);109 rc = copy_to_uspace(dst, answer->buffer, size); 110 110 if (rc) 111 IPC_SET_RETVAL(answer->data, rc);111 ipc_set_retval(&answer->data, rc); 112 112 } 113 113
Note:
See TracChangeset
for help on using the changeset viewer.