Changes in kernel/generic/src/ipc/sysipc.c [ae66564:09024119] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
rae66564 r09024119 106 106 { 107 107 switch (imethod) { 108 case IPC_M_PAGE_IN:109 108 case IPC_M_SHARE_OUT: 110 109 case IPC_M_SHARE_IN: … … 138 137 case IPC_M_CONNECT_TO_ME: 139 138 case IPC_M_CONNECT_ME_TO: 140 case IPC_M_PAGE_IN:141 139 case IPC_M_SHARE_OUT: 142 140 case IPC_M_SHARE_IN: … … 259 257 { 260 258 return SYSIPC_OP(request_process, call, box); 261 }262 263 /** Make a call over IPC and wait for reply.264 *265 * @param phoneid Phone handle for the call.266 * @param data[inout] Structure with request/reply data.267 * @param priv Value to be stored in call->priv.268 *269 * @return EOK on success.270 * @return ENOENT if there is no such phone handle.271 *272 */273 int ipc_req_internal(int phoneid, ipc_data_t *data, sysarg_t priv)274 {275 phone_t *phone;276 if (phone_get(phoneid, &phone) != EOK)277 return ENOENT;278 279 call_t *call = ipc_call_alloc(0);280 call->priv = priv;281 memcpy(call->data.args, data->args, sizeof(data->args));282 283 int rc = request_preprocess(call, phone);284 if (!rc) {285 #ifdef CONFIG_UDEBUG286 udebug_stoppable_begin();287 #endif288 289 ipc_call_hold(call);290 rc = ipc_call_sync(phone, call);291 spinlock_lock(&call->forget_lock);292 bool forgotten = call->forget;293 spinlock_unlock(&call->forget_lock);294 ipc_call_release(call);295 296 #ifdef CONFIG_UDEBUG297 udebug_stoppable_end();298 #endif299 300 if (rc != EOK) {301 if (!forgotten) {302 /*303 * There was an error, but it did not result304 * in the call being forgotten. In fact, the305 * call was not even sent. We are still306 * its owners and are responsible for its307 * deallocation.308 */309 ipc_call_free(call);310 } else {311 /*312 * The call was forgotten and it changed hands.313 * We are no longer expected to free it.314 */315 ASSERT(rc == EINTR);316 }317 return rc;318 }319 320 process_answer(call);321 } else322 IPC_SET_RETVAL(call->data, rc);323 324 memcpy(data->args, call->data.args, sizeof(data->args));325 ipc_call_free(call);326 327 return EOK;328 259 } 329 260
Note:
See TracChangeset
for help on using the changeset viewer.