Changes in kernel/generic/src/ipc/sysipc.c [455241b:b169619] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
r455241b rb169619 199 199 list_remove(&phone->link); 200 200 /* Drop callee->connected_phones reference */ 201 kobject_put( &phone->kobject);201 kobject_put(phone->kobject); 202 202 phone->state = IPC_PHONE_SLAMMED; 203 203 phone->label = 0; … … 273 273 ipc_req_internal(cap_phone_handle_t handle, ipc_data_t *data, sysarg_t priv) 274 274 { 275 phone_t *phone = phone_from_kobject( 276 kobject_get(TASK, handle, KOBJECT_TYPE_PHONE)); 277 if (!phone) 275 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); 276 if (!kobj->phone) 278 277 return ENOENT; 279 278 280 279 call_t *call = ipc_call_alloc(); 281 280 if (!call) { 282 kobject_put( &phone->kobject);281 kobject_put(kobj); 283 282 return ENOMEM; 284 283 } … … 287 286 memcpy(call->data.args, data->args, sizeof(data->args)); 288 287 289 errno_t rc = request_preprocess(call, phone);288 errno_t rc = request_preprocess(call, kobj->phone); 290 289 if (!rc) { 291 290 #ifdef CONFIG_UDEBUG … … 293 292 #endif 294 293 295 kobject_add_ref( &call->kobject);296 rc = ipc_call_sync( phone, call);294 kobject_add_ref(call->kobject); 295 rc = ipc_call_sync(kobj->phone, call); 297 296 spinlock_lock(&call->forget_lock); 298 297 bool forgotten = call->forget; 299 298 spinlock_unlock(&call->forget_lock); 300 kobject_put( &call->kobject);299 kobject_put(call->kobject); 301 300 302 301 #ifdef CONFIG_UDEBUG … … 313 312 * deallocation. 314 313 */ 315 kobject_put( &call->kobject);314 kobject_put(call->kobject); 316 315 } else { 317 316 /* … … 321 320 assert(rc == EINTR); 322 321 } 323 kobject_put( &phone->kobject);322 kobject_put(kobj); 324 323 return rc; 325 324 } … … 330 329 331 330 memcpy(data->args, call->data.args, sizeof(data->args)); 332 kobject_put( &call->kobject);333 kobject_put( &phone->kobject);331 kobject_put(call->kobject); 332 kobject_put(kobj); 334 333 335 334 return EOK; … … 371 370 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t label) 372 371 { 373 phone_t *phone = phone_from_kobject( 374 kobject_get(TASK, handle, KOBJECT_TYPE_PHONE)); 375 376 if (!phone) 372 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); 373 if (!kobj) 377 374 return ENOENT; 378 375 379 if (check_call_limit( phone)) {380 kobject_put( &phone->kobject);376 if (check_call_limit(kobj->phone)) { 377 kobject_put(kobj); 381 378 return ELIMIT; 382 379 } … … 384 381 call_t *call = ipc_call_alloc(); 385 382 if (!call) { 386 kobject_put( &phone->kobject);383 kobject_put(kobj); 387 384 return ENOMEM; 388 385 } … … 402 399 call->data.answer_label = label; 403 400 404 errno_t res = request_preprocess(call, phone);401 errno_t res = request_preprocess(call, kobj->phone); 405 402 406 403 if (!res) 407 ipc_call( phone, call);404 ipc_call(kobj->phone, call); 408 405 else 409 ipc_backsend_err( phone, call, res);410 411 kobject_put( &phone->kobject);406 ipc_backsend_err(kobj->phone, call, res); 407 408 kobject_put(kobj); 412 409 return EOK; 413 410 } … … 425 422 sysarg_t label) 426 423 { 427 phone_t *phone = phone_from_kobject( 428 kobject_get(TASK, handle, KOBJECT_TYPE_PHONE)); 429 if (!phone) 424 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); 425 if (!kobj) 430 426 return ENOENT; 431 427 432 if (check_call_limit( phone)) {433 kobject_put( &phone->kobject);428 if (check_call_limit(kobj->phone)) { 429 kobject_put(kobj); 434 430 return ELIMIT; 435 431 } … … 437 433 call_t *call = ipc_call_alloc(); 438 434 if (!call) { 439 kobject_put( &phone->kobject);435 kobject_put(kobj); 440 436 return ENOMEM; 441 437 } … … 444 440 sizeof(call->data.args)); 445 441 if (rc != EOK) { 446 kobject_put( &call->kobject);447 kobject_put( &phone->kobject);442 kobject_put(call->kobject); 443 kobject_put(kobj); 448 444 return (sys_errno_t) rc; 449 445 } … … 452 448 call->data.answer_label = label; 453 449 454 errno_t res = request_preprocess(call, phone);450 errno_t res = request_preprocess(call, kobj->phone); 455 451 456 452 if (!res) 457 ipc_call( phone, call);453 ipc_call(kobj->phone, call); 458 454 else 459 ipc_backsend_err( phone, call, res);460 461 kobject_put( &phone->kobject);455 ipc_backsend_err(kobj->phone, call, res); 456 457 kobject_put(kobj); 462 458 return EOK; 463 459 } … … 493 489 return ENOENT; 494 490 495 call_t *call = c all_from_kobject(ckobj);491 call_t *call = ckobj->call; 496 492 497 493 ipc_data_t old; … … 555 551 } 556 552 557 rc = ipc_forward(call, p hone_from_kobject(pkobj), &TASK->answerbox, mode);553 rc = ipc_forward(call, pkobj->phone, &TASK->answerbox, mode); 558 554 if (rc != EOK) { 559 555 after_forward = true; … … 663 659 return ENOENT; 664 660 665 call_t *call = call_from_kobject(kobj);661 call_t *call = kobj->call; 666 662 assert(!(call->flags & IPC_CALL_ANSWERED)); 667 663 … … 710 706 return ENOENT; 711 707 712 call_t *call = call_from_kobject(kobj);708 call_t *call = kobj->call; 713 709 assert(!(call->flags & IPC_CALL_ANSWERED)); 714 710 … … 755 751 return ENOENT; 756 752 757 errno_t rc = ipc_phone_hangup( phone_from_kobject(kobj));753 errno_t rc = ipc_phone_hangup(kobj->phone); 758 754 kobject_put(kobj); 759 755 cap_free(TASK, handle); … … 801 797 802 798 STRUCT_TO_USPACE(calldata, &call->data); 803 kobject_put( &call->kobject);799 kobject_put(call->kobject); 804 800 805 801 return EOK; … … 810 806 811 807 if (call->flags & IPC_CALL_DISCARD_ANSWER) { 812 kobject_put( &call->kobject);808 kobject_put(call->kobject); 813 809 goto restart; 814 810 } … … 817 813 818 814 STRUCT_TO_USPACE(calldata, &call->data); 819 kobject_put( &call->kobject);815 kobject_put(call->kobject); 820 816 821 817 return EOK; … … 840 836 goto error; 841 837 842 kobject_add_ref( &call->kobject);843 cap_publish(TASK, handle, &call->kobject);838 kobject_add_ref(call->kobject); 839 cap_publish(TASK, handle, call->kobject); 844 840 return EOK; 845 841
Note:
See TracChangeset
for help on using the changeset viewer.