Changeset 5d3ed34 in mainline for kernel/generic/src/ipc/ops/concttome.c
- Timestamp:
- 2012-09-03T21:39:37Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c9bbaf
- Parents:
- 9ef1b79b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/concttome.c
r9ef1b79b r5d3ed34 40 40 #include <arch.h> 41 41 42 static int request_preprocess(call_t *call, phone_t *phone) 43 { 44 /* Start with the assumption that there is no allocated phoneid. */ 45 IPC_SET_ARG5(call->data, -1); 46 return EOK; 47 } 48 42 49 static int request_process(call_t *call, answerbox_t *box) 43 50 { 44 51 int phoneid = phone_alloc(TASK); 45 52 46 if (phoneid < 0) {47 IPC_SET_RETVAL(call->data, ELIMIT);48 /*49 * This is a shortcut which bypasses the standard call50 * processing hooks. We are still playing it save here as51 * there is no state to be cleaned up at this stage.52 */53 ipc_answer(box, call);54 return -1;55 }56 57 53 IPC_SET_ARG5(call->data, phoneid); 58 54 … … 64 60 int phoneid = (int) IPC_GET_ARG5(*olddata); 65 61 66 phone_dealloc(phoneid); 62 if (phoneid >= 0) 63 phone_dealloc(phoneid); 67 64 } 68 65 … … 74 71 /* The connection was not accepted */ 75 72 answer_cleanup(answer, olddata); 76 } else {73 } else if (phoneid >= 0) { 77 74 /* The connection was accepted */ 78 75 phone_connect(phoneid, &answer->sender->answerbox); 79 76 /* Set 'phone hash' as arg5 of response */ 80 77 IPC_SET_ARG5(answer->data, (sysarg_t) &TASK->phones[phoneid]); 78 } else { 79 IPC_SET_RETVAL(answer->data, ELIMIT); 81 80 } 82 81 … … 86 85 87 86 sysipc_ops_t ipc_m_connect_to_me_ops = { 88 .request_preprocess = null_request_preprocess,87 .request_preprocess = request_preprocess, 89 88 .request_forget = null_request_forget, 90 89 .request_process = request_process,
Note:
See TracChangeset
for help on using the changeset viewer.