Changes in kernel/generic/src/ipc/ops/datawrite.c [aafed15:5a5269d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/datawrite.c
raafed15 r5a5269d 43 43 static errno_t request_preprocess(call_t *call, phone_t *phone) 44 44 { 45 u intptr_t src = IPC_GET_ARG1(call->data);46 size_t size = IPC_GET_ARG2(call->data);45 uspace_addr_t src = ipc_get_arg1(&call->data); 46 size_t size = ipc_get_arg2(&call->data); 47 47 48 48 if (size > DATA_XFER_LIMIT) { 49 int flags = IPC_GET_ARG3(call->data);49 int flags = ipc_get_arg3(&call->data); 50 50 51 51 if (flags & IPC_XF_RESTRICT) { 52 52 size = DATA_XFER_LIMIT; 53 IPC_SET_ARG2(call->data, size);53 ipc_set_arg2(&call->data, size); 54 54 } else 55 55 return ELIMIT; … … 59 59 if (!call->buffer) 60 60 return ENOMEM; 61 errno_t rc = copy_from_uspace(call->buffer, (void *)src, size);61 errno_t rc = copy_from_uspace(call->buffer, src, size); 62 62 if (rc != EOK) { 63 63 /* … … 75 75 assert(answer->buffer); 76 76 77 if (! IPC_GET_RETVAL(answer->data)) {77 if (!ipc_get_retval(&answer->data)) { 78 78 /* The recipient agreed to receive data. */ 79 u intptr_t dst = (uintptr_t)IPC_GET_ARG1(answer->data);80 size_t size = (size_t)IPC_GET_ARG2(answer->data);81 size_t max_size = (size_t)IPC_GET_ARG2(*olddata);79 uspace_addr_t dst = ipc_get_arg1(&answer->data); 80 size_t size = ipc_get_arg2(&answer->data); 81 size_t max_size = ipc_get_arg2(olddata); 82 82 83 83 if (size <= max_size) { 84 errno_t rc = copy_to_uspace( (void *)dst,84 errno_t rc = copy_to_uspace(dst, 85 85 answer->buffer, size); 86 86 if (rc) 87 IPC_SET_RETVAL(answer->data, rc);87 ipc_set_retval(&answer->data, rc); 88 88 } else { 89 IPC_SET_RETVAL(answer->data, ELIMIT);89 ipc_set_retval(&answer->data, ELIMIT); 90 90 } 91 91 }
Note:
See TracChangeset
for help on using the changeset viewer.