Rev 2622 | Rev 2636 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2622 | Rev 2635 | ||
|---|---|---|---|
| Line 189... | Line 189... | ||
| 189 | (unative_t) &TASK->phones[phoneid]); |
189 | (unative_t) &TASK->phones[phoneid]); |
| 190 | } |
190 | } |
| 191 | } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) { |
191 | } else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_ME_TO) { |
| 192 | /* If the users accepted call, connect */ |
192 | /* If the users accepted call, connect */ |
| 193 | if (!IPC_GET_RETVAL(answer->data)) { |
193 | if (!IPC_GET_RETVAL(answer->data)) { |
| 194 | ipc_phone_connect((phone_t *) IPC_GET_ARG3(*olddata), |
194 | ipc_phone_connect((phone_t *) IPC_GET_ARG5(*olddata), |
| 195 | &TASK->answerbox); |
195 | &TASK->answerbox); |
| 196 | } |
196 | } |
| 197 | } else if (IPC_GET_METHOD(*olddata) == IPC_M_AS_AREA_SEND) { |
197 | } else if (IPC_GET_METHOD(*olddata) == IPC_M_AS_AREA_SEND) { |
| 198 | if (!IPC_GET_RETVAL(answer->data)) { |
198 | if (!IPC_GET_RETVAL(answer->data)) { |
| 199 | /* Accepted, handle as_area receipt */ |
199 | /* Accepted, handle as_area receipt */ |
| Line 268... | Line 268... | ||
| 268 | case IPC_M_CONNECT_ME_TO: |
268 | case IPC_M_CONNECT_ME_TO: |
| 269 | newphid = phone_alloc(); |
269 | newphid = phone_alloc(); |
| 270 | if (newphid < 0) |
270 | if (newphid < 0) |
| 271 | return ELIMIT; |
271 | return ELIMIT; |
| 272 | /* Set arg3 for server */ |
272 | /* Set arg3 for server */ |
| 273 | IPC_SET_ARG3(call->data, (unative_t) &TASK->phones[newphid]); |
273 | IPC_SET_ARG5(call->data, (unative_t) &TASK->phones[newphid]); |
| 274 | call->flags |= IPC_CALL_CONN_ME_TO; |
274 | call->flags |= IPC_CALL_CONN_ME_TO; |
| 275 | call->priv = newphid; |
275 | call->priv = newphid; |
| 276 | break; |
276 | break; |
| 277 | case IPC_M_AS_AREA_SEND: |
277 | case IPC_M_AS_AREA_SEND: |
| 278 | size = as_area_get_size(IPC_GET_ARG1(call->data)); |
278 | size = as_area_get_size(IPC_GET_ARG1(call->data)); |
| Line 316... | Line 316... | ||
| 316 | 316 | ||
| 317 | if (call->flags & IPC_CALL_CONN_ME_TO) { |
317 | if (call->flags & IPC_CALL_CONN_ME_TO) { |
| 318 | if (IPC_GET_RETVAL(call->data)) |
318 | if (IPC_GET_RETVAL(call->data)) |
| 319 | phone_dealloc(call->priv); |
319 | phone_dealloc(call->priv); |
| 320 | else |
320 | else |
| 321 | IPC_SET_ARG3(call->data, call->priv); |
321 | IPC_SET_ARG5(call->data, call->priv); |
| 322 | } |
322 | } |
| 323 | } |
323 | } |
| 324 | 324 | ||
| 325 | /** Do basic kernel processing of received call request. |
325 | /** Do basic kernel processing of received call request. |
| 326 | * |
326 | * |
| Line 550... | Line 550... | ||
| 550 | * Warning: When implementing support for changing additional payload |
550 | * Warning: When implementing support for changing additional payload |
| 551 | * arguments, make sure that ARG3 is not rewritten for certain |
551 | * arguments, make sure that ARG3 is not rewritten for certain |
| 552 | * system IPC |
552 | * system IPC |
| 553 | */ |
553 | */ |
| 554 | unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, |
554 | unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, |
| 555 | unative_t method, unative_t arg1, int mode) |
555 | unative_t method, unative_t arg1, unative_t arg2, int mode) |
| 556 | { |
556 | { |
| 557 | call_t *call; |
557 | call_t *call; |
| 558 | phone_t *phone; |
558 | phone_t *phone; |
| 559 | 559 | ||
| 560 | call = get_call(callid); |
560 | call = get_call(callid); |
| Line 575... | Line 575... | ||
| 575 | return EPERM; |
575 | return EPERM; |
| 576 | } |
576 | } |
| 577 | 577 | ||
| 578 | /* |
578 | /* |
| 579 | * Userspace is not allowed to change method of system methods on |
579 | * Userspace is not allowed to change method of system methods on |
| 580 | * forward, allow changing ARG1 and ARG2 by means of method and arg1. |
580 | * forward, allow changing ARG1, ARG2 and ARG3 by means of method, |
| - | 581 | * arg1 and arg2. |
|
| 581 | * If the method is immutable, don't change anything. |
582 | * If the method is immutable, don't change anything. |
| 582 | */ |
583 | */ |
| 583 | if (!method_is_immutable(IPC_GET_METHOD(call->data))) { |
584 | if (!method_is_immutable(IPC_GET_METHOD(call->data))) { |
| 584 | if (method_is_system(IPC_GET_METHOD(call->data))) { |
585 | if (method_is_system(IPC_GET_METHOD(call->data))) { |
| 585 | if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) |
586 | if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) |
| 586 | phone_dealloc(IPC_GET_ARG3(call->data)); |
587 | phone_dealloc(IPC_GET_ARG5(call->data)); |
| 587 | 588 | ||
| 588 | IPC_SET_ARG1(call->data, method); |
589 | IPC_SET_ARG1(call->data, method); |
| 589 | IPC_SET_ARG2(call->data, arg1); |
590 | IPC_SET_ARG2(call->data, arg1); |
| - | 591 | IPC_SET_ARG3(call->data, arg2); |
|
| 590 | } else { |
592 | } else { |
| 591 | IPC_SET_METHOD(call->data, method); |
593 | IPC_SET_METHOD(call->data, method); |
| 592 | IPC_SET_ARG1(call->data, arg1); |
594 | IPC_SET_ARG1(call->data, arg1); |
| - | 595 | IPC_SET_ARG2(call->data, arg2); |
|
| 593 | } |
596 | } |
| 594 | } |
597 | } |
| 595 | 598 | ||
| 596 | return ipc_forward(call, phone, &TASK->answerbox, mode); |
599 | return ipc_forward(call, phone, &TASK->answerbox, mode); |
| 597 | } |
600 | } |