Changeset 0dc4258 in mainline
- Timestamp:
- 2007-09-29T12:21:39Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb725a9
- Parents:
- b878df3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
rb878df3 r0dc4258 70 70 * Otherwise return 0. 71 71 */ 72 static inline int is_system_method(unative_t method)72 static inline int method_is_system(unative_t method) 73 73 { 74 74 if (method <= IPC_M_LAST_SYSTEM) … … 87 87 * Otherwise return 0. 88 88 */ 89 static inline int is_forwardable(unative_t method)89 static inline int method_is_forwardable(unative_t method) 90 90 { 91 91 switch (method) { 92 92 case IPC_M_PHONE_HUNGUP: 93 case IPC_M_AS_AREA_SEND:94 case IPC_M_AS_AREA_RECV:95 case IPC_M_DATA_SEND:96 93 /* This message is meant only for the original recipient. */ 97 94 return 0; 98 95 default: 99 96 return 1; 97 } 98 } 99 100 /** Decide if the message with this method is immutable on forward. 101 * 102 * - some system messages may be forwarded, for some of them 103 * it is useless 104 * 105 * @param method Method to be decided. 106 * 107 * @return Return 1 if the method is immutable on forward. 108 * Otherwise return 0. 109 */ 110 static inline int method_is_immutable(unative_t method) 111 { 112 switch (method) { 113 case IPC_M_AS_AREA_SEND: 114 case IPC_M_AS_AREA_RECV: 115 case IPC_M_DATA_SEND: 116 return 1; 117 break; 118 default: 119 return 0; 100 120 } 101 121 } … … 504 524 * in the forwarded message with the new method and the new arg1, respectively. 505 525 * Otherwise the METHOD and ARG1 are rewritten with the new method and arg1, 506 * respectively. 526 * respectively. Also note there is a set of immutable methods, for which the 527 * new method and argument is not set and these values are ignored. 507 528 * 508 529 * Warning: If implementing non-fast version, make sure that … … 527 548 }); 528 549 529 if (! is_forwardable(IPC_GET_METHOD(call->data))) {550 if (!method_is_forwardable(IPC_GET_METHOD(call->data))) { 530 551 IPC_SET_RETVAL(call->data, EFORWARD); 531 552 ipc_answer(&TASK->answerbox, call); … … 533 554 } 534 555 535 /* Userspace is not allowed to change method of system methods 536 * on forward, allow changing ARG1 and ARG2 by means of method and arg1 556 /* 557 * Userspace is not allowed to change method of system methods on 558 * forward, allow changing ARG1 and ARG2 by means of method and arg1. 559 * If the method is immutable, don't change anything. 537 560 */ 538 if (is_system_method(IPC_GET_METHOD(call->data))) { 539 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) 540 phone_dealloc(IPC_GET_ARG3(call->data)); 541 542 IPC_SET_ARG1(call->data, method); 543 IPC_SET_ARG2(call->data, arg1); 544 } else { 545 IPC_SET_METHOD(call->data, method); 546 IPC_SET_ARG1(call->data, arg1); 561 if (!method_is_immutable(IPC_GET_METHOD(call->data))) { 562 if (method_is_system(IPC_GET_METHOD(call->data))) { 563 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) 564 phone_dealloc(IPC_GET_ARG3(call->data)); 565 566 IPC_SET_ARG1(call->data, method); 567 IPC_SET_ARG2(call->data, arg1); 568 } else { 569 IPC_SET_METHOD(call->data, method); 570 IPC_SET_ARG1(call->data, arg1); 571 } 547 572 } 548 573
Note:
See TracChangeset
for help on using the changeset viewer.