Changeset 6caf5fb in mainline for kernel/generic/src/ipc/sysipc.c
- Timestamp:
- 2025-01-16T21:42:15Z (20 hours ago)
- Parents:
- e0e2264 (diff), 455241b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-01-16 21:42:15)
- git-committer:
- GitHub <noreply@…> (2025-01-16 21:42:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
re0e2264 r6caf5fb 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 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); 276 if (!kobj->phone) 275 phone_t *phone = phone_from_kobject( 276 kobject_get(TASK, handle, KOBJECT_TYPE_PHONE)); 277 if (!phone) 277 278 return ENOENT; 278 279 279 280 call_t *call = ipc_call_alloc(); 280 281 if (!call) { 281 kobject_put( kobj);282 kobject_put(&phone->kobject); 282 283 return ENOMEM; 283 284 } … … 286 287 memcpy(call->data.args, data->args, sizeof(data->args)); 287 288 288 errno_t rc = request_preprocess(call, kobj->phone);289 errno_t rc = request_preprocess(call, phone); 289 290 if (!rc) { 290 291 #ifdef CONFIG_UDEBUG … … 292 293 #endif 293 294 294 kobject_add_ref( call->kobject);295 rc = ipc_call_sync( kobj->phone, call);295 kobject_add_ref(&call->kobject); 296 rc = ipc_call_sync(phone, call); 296 297 spinlock_lock(&call->forget_lock); 297 298 bool forgotten = call->forget; 298 299 spinlock_unlock(&call->forget_lock); 299 kobject_put( call->kobject);300 kobject_put(&call->kobject); 300 301 301 302 #ifdef CONFIG_UDEBUG … … 312 313 * deallocation. 313 314 */ 314 kobject_put( call->kobject);315 kobject_put(&call->kobject); 315 316 } else { 316 317 /* … … 320 321 assert(rc == EINTR); 321 322 } 322 kobject_put( kobj);323 kobject_put(&phone->kobject); 323 324 return rc; 324 325 } … … 329 330 330 331 memcpy(data->args, call->data.args, sizeof(data->args)); 331 kobject_put( call->kobject);332 kobject_put( kobj);332 kobject_put(&call->kobject); 333 kobject_put(&phone->kobject); 333 334 334 335 return EOK; … … 370 371 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t label) 371 372 { 372 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); 373 if (!kobj) 373 phone_t *phone = phone_from_kobject( 374 kobject_get(TASK, handle, KOBJECT_TYPE_PHONE)); 375 376 if (!phone) 374 377 return ENOENT; 375 378 376 if (check_call_limit( kobj->phone)) {377 kobject_put( kobj);379 if (check_call_limit(phone)) { 380 kobject_put(&phone->kobject); 378 381 return ELIMIT; 379 382 } … … 381 384 call_t *call = ipc_call_alloc(); 382 385 if (!call) { 383 kobject_put( kobj);386 kobject_put(&phone->kobject); 384 387 return ENOMEM; 385 388 } … … 399 402 call->data.answer_label = label; 400 403 401 errno_t res = request_preprocess(call, kobj->phone);404 errno_t res = request_preprocess(call, phone); 402 405 403 406 if (!res) 404 ipc_call( kobj->phone, call);407 ipc_call(phone, call); 405 408 else 406 ipc_backsend_err( kobj->phone, call, res);407 408 kobject_put( kobj);409 ipc_backsend_err(phone, call, res); 410 411 kobject_put(&phone->kobject); 409 412 return EOK; 410 413 } … … 422 425 sysarg_t label) 423 426 { 424 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); 425 if (!kobj) 427 phone_t *phone = phone_from_kobject( 428 kobject_get(TASK, handle, KOBJECT_TYPE_PHONE)); 429 if (!phone) 426 430 return ENOENT; 427 431 428 if (check_call_limit( kobj->phone)) {429 kobject_put( kobj);432 if (check_call_limit(phone)) { 433 kobject_put(&phone->kobject); 430 434 return ELIMIT; 431 435 } … … 433 437 call_t *call = ipc_call_alloc(); 434 438 if (!call) { 435 kobject_put( kobj);439 kobject_put(&phone->kobject); 436 440 return ENOMEM; 437 441 } … … 440 444 sizeof(call->data.args)); 441 445 if (rc != EOK) { 442 kobject_put( call->kobject);443 kobject_put( kobj);446 kobject_put(&call->kobject); 447 kobject_put(&phone->kobject); 444 448 return (sys_errno_t) rc; 445 449 } … … 448 452 call->data.answer_label = label; 449 453 450 errno_t res = request_preprocess(call, kobj->phone);454 errno_t res = request_preprocess(call, phone); 451 455 452 456 if (!res) 453 ipc_call( kobj->phone, call);457 ipc_call(phone, call); 454 458 else 455 ipc_backsend_err( kobj->phone, call, res);456 457 kobject_put( kobj);459 ipc_backsend_err(phone, call, res); 460 461 kobject_put(&phone->kobject); 458 462 return EOK; 459 463 } … … 489 493 return ENOENT; 490 494 491 call_t *call = c kobj->call;495 call_t *call = call_from_kobject(ckobj); 492 496 493 497 ipc_data_t old; … … 551 555 } 552 556 553 rc = ipc_forward(call, p kobj->phone, &TASK->answerbox, mode);557 rc = ipc_forward(call, phone_from_kobject(pkobj), &TASK->answerbox, mode); 554 558 if (rc != EOK) { 555 559 after_forward = true; … … 659 663 return ENOENT; 660 664 661 call_t *call = kobj->call;665 call_t *call = call_from_kobject(kobj); 662 666 assert(!(call->flags & IPC_CALL_ANSWERED)); 663 667 … … 706 710 return ENOENT; 707 711 708 call_t *call = kobj->call;712 call_t *call = call_from_kobject(kobj); 709 713 assert(!(call->flags & IPC_CALL_ANSWERED)); 710 714 … … 751 755 return ENOENT; 752 756 753 errno_t rc = ipc_phone_hangup( kobj->phone);757 errno_t rc = ipc_phone_hangup(phone_from_kobject(kobj)); 754 758 kobject_put(kobj); 755 759 cap_free(TASK, handle); … … 797 801 798 802 STRUCT_TO_USPACE(calldata, &call->data); 799 kobject_put( call->kobject);803 kobject_put(&call->kobject); 800 804 801 805 return EOK; … … 806 810 807 811 if (call->flags & IPC_CALL_DISCARD_ANSWER) { 808 kobject_put( call->kobject);812 kobject_put(&call->kobject); 809 813 goto restart; 810 814 } … … 813 817 814 818 STRUCT_TO_USPACE(calldata, &call->data); 815 kobject_put( call->kobject);819 kobject_put(&call->kobject); 816 820 817 821 return EOK; … … 836 840 goto error; 837 841 838 kobject_add_ref( call->kobject);839 cap_publish(TASK, handle, call->kobject);842 kobject_add_ref(&call->kobject); 843 cap_publish(TASK, handle, &call->kobject); 840 844 return EOK; 841 845
Note:
See TracChangeset
for help on using the changeset viewer.