Changeset f5837524 in mainline for kernel/generic/src/ipc/ops/concttome.c
- Timestamp:
- 2018-10-29T17:15:02Z (5 years ago)
- Children:
- eec201d
- Parents:
- 184f2f8a
- git-author:
- Jakub Jermar <jakub@…> (2018-10-28 12:42:35)
- git-committer:
- Jakub Jermar <jakub@…> (2018-10-29 17:15:02)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/concttome.c
r184f2f8a rf5837524 42 42 static int request_process(call_t *call, answerbox_t *box) 43 43 { 44 cap_phone_handle_t phone_handle; 45 kobject_t *phone_obj; 46 errno_t rc = phone_alloc(TASK, false, &phone_handle, &phone_obj); 47 call->priv = (sysarg_t) phone_obj; 48 IPC_SET_ARG5(call->data, 49 (rc == EOK) ? CAP_HANDLE_RAW(phone_handle) : CAP_NIL); 44 cap_phone_handle_t phandle = CAP_NIL; 45 kobject_t *pobj = NULL; 46 errno_t rc = phone_alloc(TASK, false, &phandle, &pobj); 47 if (rc == EOK) { 48 /* 49 * Set the sender-assigned label to the new phone. 50 */ 51 pobj->phone->label = IPC_GET_ARG5(call->data); 52 } 53 call->priv = (sysarg_t) pobj; 54 IPC_SET_ARG5(call->data, CAP_HANDLE_RAW(phandle)); 50 55 return 0; 51 56 } … … 53 58 static errno_t answer_cleanup(call_t *answer, ipc_data_t *olddata) 54 59 { 55 cap_phone_handle_t ph one_handle = (cap_handle_t) IPC_GET_ARG5(*olddata);56 kobject_t *p hone_obj = (kobject_t *) answer->priv;60 cap_phone_handle_t phandle = (cap_handle_t) IPC_GET_ARG5(*olddata); 61 kobject_t *pobj = (kobject_t *) answer->priv; 57 62 58 if (CAP_HANDLE_VALID(ph one_handle)) {59 kobject_put(p hone_obj);60 cap_free(TASK, ph one_handle);63 if (CAP_HANDLE_VALID(phandle)) { 64 kobject_put(pobj); 65 cap_free(TASK, phandle); 61 66 } 62 67 … … 66 71 static errno_t answer_preprocess(call_t *answer, ipc_data_t *olddata) 67 72 { 68 cap_phone_handle_t ph one_handle = (cap_handle_t) IPC_GET_ARG5(*olddata);69 kobject_t *p hone_obj = (kobject_t *) answer->priv;73 cap_phone_handle_t phandle = (cap_handle_t) IPC_GET_ARG5(*olddata); 74 kobject_t *pobj = (kobject_t *) answer->priv; 70 75 71 76 if (IPC_GET_RETVAL(answer->data) != EOK) { 72 77 /* The connection was not accepted */ 73 78 answer_cleanup(answer, olddata); 74 } else if (CAP_HANDLE_VALID(ph one_handle)) {79 } else if (CAP_HANDLE_VALID(phandle)) { 75 80 /* 76 81 * The connection was accepted … … 81 86 * will be consumed by ipc_phone_connect(). 82 87 */ 83 kobject_add_ref(p hone_obj);88 kobject_add_ref(pobj); 84 89 85 if (ipc_phone_connect(p hone_obj->phone,90 if (ipc_phone_connect(pobj->phone, 86 91 &answer->sender->answerbox)) { 87 92 /* Pass the reference to the capability */ 88 cap_publish(TASK, phone_handle, phone_obj); 89 /* Set 'phone hash' as ARG5 of response */ 90 IPC_SET_ARG5(answer->data, 91 (sysarg_t) phone_obj->phone); 93 cap_publish(TASK, phandle, pobj); 92 94 } else { 93 95 /* The answerbox is shutting down. */
Note:
See TracChangeset
for help on using the changeset viewer.