Changeset 9f22213 in mainline for generic/src/ipc/sysipc.c
- Timestamp:
- 2006-03-19T12:43:12Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7c7aae16
- Parents:
- b4b45210
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/ipc/sysipc.c
rb4b45210 r9f22213 76 76 77 77 /** Return true if the caller (ipc_answer) should save 78 * the old call contents and callanswer_preprocess79 */ 80 static inline int answer_ will_preprocess(call_t *call)78 * the old call contents for answer_preprocess 79 */ 80 static inline int answer_need_old(call_t *call) 81 81 { 82 82 if (IPC_GET_METHOD(call->data) == IPC_M_CONNECT_TO_ME) … … 91 91 { 92 92 int phoneid; 93 94 if (IPC_GET_RETVAL(answer->data) == EHANGUP) { 95 /* Atomic operation */ 96 answer->data.phone->callee = NULL; 97 } 98 99 if (!olddata) 100 return; 93 101 94 102 if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECT_TO_ME) { … … 98 106 phone_dealloc(phoneid); 99 107 } else { 100 /* The connection was accepted */108 /* The connection was accepted */ 101 109 phone_connect(phoneid,&answer->sender->answerbox); 102 110 } … … 118 126 static int process_answer(answerbox_t *box,call_t *call) 119 127 { 128 if (IPC_GET_RETVAL(call->data) == EHANGUP && \ 129 call->flags & IPC_CALL_FORWARDED) 130 IPC_SET_RETVAL(call->data, EFORWARD); 120 131 return 0; 121 132 } … … 276 287 return ENOENT; 277 288 289 call->flags |= IPC_CALL_FORWARDED; 290 278 291 GET_CHECK_PHONE(phone, phoneid, { 279 292 IPC_SET_RETVAL(call->data, EFORWARD); … … 299 312 } 300 313 301 ipc_forward(call, phone, &TASK->answerbox); 302 303 return 0; 314 return ipc_forward(call, phone, &TASK->answerbox); 304 315 } 305 316 … … 310 321 call_t *call; 311 322 ipc_data_t saved_data; 312 int preprocess= 0;323 int saveddata = 0; 313 324 314 325 call = get_call(callid); … … 316 327 return ENOENT; 317 328 318 if (answer_ will_preprocess(call)) {329 if (answer_need_old(call)) { 319 330 memcpy(&saved_data, &call->data, sizeof(call->data)); 320 preprocess= 1;331 saveddata = 1; 321 332 } 322 333 … … 324 335 IPC_SET_ARG1(call->data, arg1); 325 336 IPC_SET_ARG2(call->data, arg2); 326 327 if (preprocess) 328 answer_preprocess(call, &saved_data); 337 answer_preprocess(call, saveddata ? &saved_data : NULL); 329 338 330 339 ipc_answer(&TASK->answerbox, call); … … 337 346 call_t *call; 338 347 ipc_data_t saved_data; 339 int preprocess= 0;348 int saveddata = 0; 340 349 341 350 call = get_call(callid); … … 343 352 return ENOENT; 344 353 345 if (answer_ will_preprocess(call)) {354 if (answer_need_old(call)) { 346 355 memcpy(&saved_data, &call->data, sizeof(call->data)); 347 preprocess= 1;356 saveddata = 1; 348 357 } 349 358 copy_from_uspace(&call->data.args, &data->args, 350 359 sizeof(call->data.args)); 351 360 352 if (preprocess) 353 answer_preprocess(call, &saved_data); 361 answer_preprocess(call, saveddata ? &saved_data : NULL); 354 362 355 363 ipc_answer(&TASK->answerbox, call); … … 449 457 restart: 450 458 call = ipc_wait_for_call(&TASK->answerbox, flags); 459 if (!call) 460 return 0; 451 461 452 462 if (call->flags & IPC_CALL_ANSWERED) {
Note:
See TracChangeset
for help on using the changeset viewer.