Changeset b1e6269 in mainline for kernel/generic/src/ipc/ops
- 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
- Location:
- kernel/generic/src/ipc/ops
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/clnestab.c
r13dbaa8c rb1e6269 45 45 } 46 46 47 static void answer_cleanup(call_t *answer, ipc_data_t *olddata) 48 { 49 phone_t *phone = (phone_t *) IPC_GET_ARG5(*olddata); 50 51 mutex_lock(&phone->lock); 52 if (phone->state == IPC_PHONE_CONNECTED) { 53 irq_spinlock_lock(&phone->callee->lock, true); 54 list_remove(&phone->link); 55 phone->state = IPC_PHONE_SLAMMED; 56 irq_spinlock_unlock(&phone->callee->lock, true); 57 } 58 mutex_unlock(&phone->lock); 59 } 60 47 61 static int answer_preprocess(call_t *answer, ipc_data_t *olddata) 48 62 { 49 phone_t *phone = (phone_t *) IPC_GET_ARG5(*olddata);50 63 51 64 if (IPC_GET_RETVAL(answer->data) != EOK) { … … 55 68 * connection without sending IPC_M_HUNGUP back. 56 69 */ 57 mutex_lock(&phone->lock); 58 if (phone->state == IPC_PHONE_CONNECTED) { 59 irq_spinlock_lock(&phone->callee->lock, true); 60 list_remove(&phone->link); 61 phone->state = IPC_PHONE_SLAMMED; 62 irq_spinlock_unlock(&phone->callee->lock, true); 63 } 64 mutex_unlock(&phone->lock); 70 answer_cleanup(answer, olddata); 65 71 } 66 72 … … 70 76 sysipc_ops_t ipc_m_clone_establish_ops = { 71 77 .request_preprocess = request_preprocess, 78 .request_forget = null_request_forget, 72 79 .request_process = null_request_process, 80 .answer_cleanup = answer_cleanup, 73 81 .answer_preprocess = answer_preprocess, 74 82 .answer_process = null_answer_process, -
kernel/generic/src/ipc/ops/conctmeto.c
r13dbaa8c rb1e6269 54 54 } 55 55 56 static void request_forget(call_t *call) 57 { 58 phone_dealloc(call->priv); 59 } 60 56 61 static int answer_preprocess(call_t *answer, ipc_data_t *olddata) 57 62 { … … 77 82 sysipc_ops_t ipc_m_connect_me_to_ops = { 78 83 .request_preprocess = request_preprocess, 84 .request_forget = request_forget, 79 85 .request_process = null_request_process, 86 .answer_cleanup = null_answer_cleanup, 80 87 .answer_preprocess = answer_preprocess, 81 88 .answer_process = answer_process, -
kernel/generic/src/ipc/ops/concttome.c
r13dbaa8c rb1e6269 55 55 } 56 56 57 static void answer_cleanup(call_t *answer, ipc_data_t *olddata) 58 { 59 int phoneid = (int) IPC_GET_ARG5(*olddata); 60 61 phone_dealloc(phoneid); 62 } 63 57 64 static int answer_preprocess(call_t *answer, ipc_data_t *olddata) 58 65 { … … 61 68 if (IPC_GET_RETVAL(answer->data) != EOK) { 62 69 /* The connection was not accepted */ 63 int phoneid = (int) IPC_GET_ARG5(*olddata); 64 65 phone_dealloc(phoneid); 70 answer_cleanup(answer, olddata); 66 71 } else { 67 72 /* The connection was accepted */ … … 77 82 sysipc_ops_t ipc_m_connect_to_me_ops = { 78 83 .request_preprocess = null_request_preprocess, 84 .request_forget = null_request_forget, 79 85 .request_process = request_process, 86 .answer_cleanup = answer_cleanup, 80 87 .answer_preprocess = answer_preprocess, 81 88 .answer_process = null_answer_process, -
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, -
kernel/generic/src/ipc/ops/dataread.c
r13dbaa8c rb1e6269 108 108 sysipc_ops_t ipc_m_data_read_ops = { 109 109 .request_preprocess = request_preprocess, 110 .request_forget = null_request_forget, 110 111 .request_process = null_request_process, 112 .answer_cleanup = null_answer_cleanup, 111 113 .answer_preprocess = answer_preprocess, 112 114 .answer_process = answer_process, -
kernel/generic/src/ipc/ops/datawrite.c
r13dbaa8c rb1e6269 84 84 } 85 85 } 86 free(answer->buffer);87 answer->buffer = NULL;88 86 89 87 return EOK; … … 93 91 sysipc_ops_t ipc_m_data_write_ops = { 94 92 .request_preprocess = request_preprocess, 93 .request_forget = null_request_forget, 95 94 .request_process = null_request_process, 95 .answer_cleanup = null_answer_cleanup, 96 96 .answer_preprocess = answer_preprocess, 97 97 .answer_process = null_answer_process, -
kernel/generic/src/ipc/ops/debug.c
r13dbaa8c rb1e6269 65 65 .request_preprocess = null_request_preprocess, 66 66 #endif 67 .request_forget = null_request_forget, 67 68 .request_process = request_process, 69 .answer_cleanup = null_answer_cleanup, 68 70 .answer_preprocess = null_answer_preprocess, 69 71 .answer_process = answer_process, -
kernel/generic/src/ipc/ops/sharein.c
r13dbaa8c rb1e6269 61 61 sysipc_ops_t ipc_m_share_in_ops = { 62 62 .request_preprocess = null_request_preprocess, 63 .request_forget = null_request_forget, 63 64 .request_process = null_request_process, 65 .answer_cleanup = null_answer_cleanup, 64 66 .answer_preprocess = answer_preprocess, 65 67 .answer_process = null_answer_process, -
kernel/generic/src/ipc/ops/shareout.c
r13dbaa8c rb1e6269 82 82 sysipc_ops_t ipc_m_share_out_ops = { 83 83 .request_preprocess = request_preprocess, 84 .request_forget = null_request_forget, 84 85 .request_process = null_request_process, 86 .answer_cleanup = null_answer_cleanup, 85 87 .answer_preprocess = answer_preprocess, 86 88 .answer_process = null_answer_process, -
kernel/generic/src/ipc/ops/stchngath.c
r13dbaa8c rb1e6269 118 118 sysipc_ops_t ipc_m_state_change_authorize_ops = { 119 119 .request_preprocess = request_preprocess, 120 .request_forget = null_request_forget, 120 121 .request_process = null_request_process, 122 .answer_cleanup = null_answer_cleanup, 121 123 .answer_preprocess = answer_preprocess, 122 124 .answer_process = null_answer_process,
Note:
See TracChangeset
for help on using the changeset viewer.