Changeset b1e6269 in mainline for kernel/generic/src/ipc/ops/connclone.c
- Timestamp:
- 2012-08-24T22:27:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 20282ef3
- Parents:
- 13dbaa8c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/connclone.c
r13dbaa8c rb1e6269 97 97 } 98 98 99 static void answer_cleanup(call_t *answer, ipc_data_t *olddata) 100 { 101 int phoneid = (int) IPC_GET_ARG1(*olddata); 102 phone_t *phone = &TASK->phones[phoneid]; 103 104 /* 105 * In this case, the connection was established at the request 106 * time and therefore we need to slam the phone. We don't 107 * merely hangup as that would result in sending IPC_M_HUNGUP 108 * to the third party on the other side of the cloned phone. 109 */ 110 mutex_lock(&phone->lock); 111 if (phone->state == IPC_PHONE_CONNECTED) { 112 irq_spinlock_lock(&phone->callee->lock, true); 113 list_remove(&phone->link); 114 phone->state = IPC_PHONE_SLAMMED; 115 irq_spinlock_unlock(&phone->callee->lock, true); 116 } 117 mutex_unlock(&phone->lock); 118 } 119 99 120 static int answer_preprocess(call_t *answer, ipc_data_t *olddata) 100 121 { … … 103 124 * The recipient of the cloned phone rejected the offer. 104 125 */ 105 int phoneid = (int) IPC_GET_ARG1(*olddata); 106 phone_t *phone = &TASK->phones[phoneid]; 107 108 /* 109 * In this case, the connection was established at the request 110 * time and therefore we need to slam the phone. We don't 111 * merely hangup as that would result in sending IPC_M_HUNGUP 112 * to the third party on the other side of the cloned phone. 113 */ 114 mutex_lock(&phone->lock); 115 if (phone->state == IPC_PHONE_CONNECTED) { 116 irq_spinlock_lock(&phone->callee->lock, true); 117 list_remove(&phone->link); 118 phone->state = IPC_PHONE_SLAMMED; 119 irq_spinlock_unlock(&phone->callee->lock, true); 120 } 121 mutex_unlock(&phone->lock); 126 answer_cleanup(answer, olddata); 122 127 } 123 128 … … 127 132 sysipc_ops_t ipc_m_connection_clone_ops = { 128 133 .request_preprocess = request_preprocess, 134 .request_forget = null_request_forget, 129 135 .request_process = null_request_process, 136 .answer_cleanup = answer_cleanup, 130 137 .answer_preprocess = answer_preprocess, 131 138 .answer_process = null_answer_process,
Note:
See TracChangeset
for help on using the changeset viewer.