Changeset e3c762cd in mainline for generic/src/ipc
- Timestamp:
- 2006-05-05T11:59:19Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de07bcf
- Parents:
- 22cf454d
- Location:
- generic/src/ipc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/ipc/irq.c
r22cf454d re3c762cd 48 48 #include <ipc/irq.h> 49 49 #include <atomic.h> 50 #include <syscall/copy.h> 50 51 51 52 typedef struct { … … 121 122 irq_code_t *code; 122 123 irq_cmd_t *ucmds; 124 int rc; 123 125 124 126 code = malloc(sizeof(*code), 0); 125 copy_from_uspace(code, ucode, sizeof(*code)); 127 rc = copy_from_uspace(code, ucode, sizeof(*code)); 128 if (rc != 0) { 129 free(code); 130 return NULL; 131 } 126 132 127 133 if (code->cmdcount > IRQ_MAX_PROG_SIZE) { … … 131 137 ucmds = code->cmds; 132 138 code->cmds = malloc(sizeof(code->cmds[0]) * (code->cmdcount), 0); 133 copy_from_uspace(code->cmds, ucmds, sizeof(code->cmds[0]) * (code->cmdcount)); 139 rc = copy_from_uspace(code->cmds, ucmds, sizeof(code->cmds[0]) * (code->cmdcount)); 140 if (rc != 0) { 141 free(code->cmds); 142 free(code); 143 return NULL; 144 } 134 145 135 146 return code; -
generic/src/ipc/sysipc.c
r22cf454d re3c762cd 29 29 #include <arch.h> 30 30 #include <proc/task.h> 31 31 #include <proc/thread.h> 32 32 #include <errno.h> 33 #include <mm/page.h>34 33 #include <memstr.h> 35 34 #include <debug.h> … … 39 38 #include <ipc/ipcrsc.h> 40 39 #include <arch/interrupt.h> 41 42 40 #include <print.h> 43 #include <arch.h> 44 #include <proc/thread.h> 41 #include <syscall/copy.h> 45 42 46 43 #define GET_CHECK_PHONE(phone,phoneid,err) { \ … … 229 226 phone_t *phone; 230 227 int res; 228 int rc; 231 229 232 230 ipc_call_static_init(&call); 233 copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args)); 231 rc = copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args)); 232 if (rc != 0) 233 return (__native) rc; 234 234 235 235 GET_CHECK_PHONE(phone, phoneid, return ENOENT); … … 241 241 IPC_SET_RETVAL(call.data, res); 242 242 243 STRUCT_TO_USPACE(&reply->args, &call.data.args); 243 rc = STRUCT_TO_USPACE(&reply->args, &call.data.args); 244 if (rc != 0) 245 return rc; 244 246 245 247 return 0; … … 298 300 phone_t *phone; 299 301 int res; 302 int rc; 300 303 301 304 if (check_call_limit()) … … 305 308 306 309 call = ipc_call_alloc(0); 307 copy_from_uspace(&call->data.args, &data->args, sizeof(call->data.args)); 310 rc = copy_from_uspace(&call->data.args, &data->args, sizeof(call->data.args)); 311 if (rc != 0) 312 return (__native) rc; 308 313 if (!(res=request_preprocess(call))) 309 314 ipc_call(phone, call); … … 394 399 ipc_data_t saved_data; 395 400 int saveddata = 0; 401 int rc; 396 402 397 403 call = get_call(callid); … … 403 409 saveddata = 1; 404 410 } 405 copy_from_uspace(&call->data.args, &data->args,411 rc = copy_from_uspace(&call->data.args, &data->args, 406 412 sizeof(call->data.args)); 413 if (rc != 0) 414 return rc; 407 415 408 416 answer_preprocess(call, saveddata ? &saved_data : NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
