Changes in kernel/generic/src/ipc/sysipc.c [228e490:f6bffee] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
r228e490 rf6bffee 248 248 /* The connection was accepted */ 249 249 phone_connect(phoneid, &answer->sender->answerbox); 250 /* Set 'task hash' as arg4 of response */ 251 IPC_SET_ARG4(answer->data, (sysarg_t) TASK); 250 252 /* Set 'phone hash' as arg5 of response */ 251 253 IPC_SET_ARG5(answer->data, … … 424 426 case IPC_M_DATA_READ: { 425 427 size_t size = IPC_GET_ARG2(call->data); 426 if ( (size <= 0 || (size > DATA_XFER_LIMIT)))428 if (size <= 0) 427 429 return ELIMIT; 428 430 if (size > DATA_XFER_LIMIT) { 431 int flags = IPC_GET_ARG3(call->data); 432 if (flags & IPC_XF_RESTRICT) 433 IPC_SET_ARG2(call->data, DATA_XFER_LIMIT); 434 else 435 return ELIMIT; 436 } 429 437 break; 430 438 } … … 433 441 size_t size = IPC_GET_ARG2(call->data); 434 442 435 if (size > DATA_XFER_LIMIT) 436 return ELIMIT; 443 if (size > DATA_XFER_LIMIT) { 444 int flags = IPC_GET_ARG3(call->data); 445 if (flags & IPC_XF_RESTRICT) { 446 size = DATA_XFER_LIMIT; 447 IPC_SET_ARG2(call->data, size); 448 } else 449 return ELIMIT; 450 } 437 451 438 452 call->buffer = (uint8_t *) malloc(size, 0); … … 1103 1117 * 1104 1118 */ 1105 sysarg_t sys_ ipc_register_irq(inr_t inr, devno_t devno, sysarg_t imethod,1119 sysarg_t sys_register_irq(inr_t inr, devno_t devno, sysarg_t imethod, 1106 1120 irq_code_t *ucode) 1107 1121 { … … 1120 1134 * 1121 1135 */ 1122 sysarg_t sys_ ipc_unregister_irq(inr_t inr, devno_t devno)1136 sysarg_t sys_unregister_irq(inr_t inr, devno_t devno) 1123 1137 { 1124 1138 if (!(cap_get(TASK) & CAP_IRQ_REG))
Note:
See TracChangeset
for help on using the changeset viewer.