Changes in kernel/generic/src/ipc/ipc.c [ab34cc9:6aef742] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rab34cc9 r6aef742 38 38 */ 39 39 40 #include <synch/synch.h> 40 41 #include <synch/spinlock.h> 41 42 #include <synch/mutex.h> 42 43 #include <synch/waitq.h> 44 #include <synch/synch.h> 43 45 #include <ipc/ipc.h> 44 #include <abi/ipc/methods.h>45 46 #include <ipc/kbox.h> 46 47 #include <ipc/event.h> … … 126 127 list_initialize(&box->answers); 127 128 list_initialize(&box->irq_notifs); 128 list_initialize(&box->irq_ list);129 list_initialize(&box->irq_head); 129 130 box->task = task; 130 131 } … … 181 182 */ 182 183 irq_spinlock_lock(&TASK->lock, true); 183 list_append(&sync_box->sync_box_link, &TASK->sync_box es);184 list_append(&sync_box->sync_box_link, &TASK->sync_box_head); 184 185 irq_spinlock_unlock(&TASK->lock, true); 185 186 … … 230 231 } 231 232 } 232 233 call->data.task_id = TASK->taskid;234 233 235 234 if (do_lock) … … 296 295 atomic_inc(&phone->active_calls); 297 296 call->data.phone = phone; 298 call->data.task _id = TASK->taskid;297 call->data.task = TASK; 299 298 } 300 299 … … 408 407 call->caller_phone = call->data.phone; 409 408 call->data.phone = newphone; 410 call->data.task _id = TASK->taskid;409 call->data.task = TASK; 411 410 } 412 411 … … 450 449 irq_spinlock_lock(&box->irq_lock, false); 451 450 452 request = list_get_instance(list_first(&box->irq_notifs), 453 call_t, link); 451 request = list_get_instance(box->irq_notifs.next, call_t, link); 454 452 list_remove(&request->link); 455 453 … … 460 458 461 459 /* Handle asynchronous answers */ 462 request = list_get_instance(list_first(&box->answers), 463 call_t, link); 460 request = list_get_instance(box->answers.next, call_t, link); 464 461 list_remove(&request->link); 465 462 atomic_dec(&request->data.phone->active_calls); … … 469 466 470 467 /* Handle requests */ 471 request = list_get_instance(list_first(&box->calls), 472 call_t, link); 468 request = list_get_instance(box->calls.next, call_t, link); 473 469 list_remove(&request->link); 474 470 … … 497 493 * 498 494 */ 499 void ipc_cleanup_call_list(li st_t *lst)495 void ipc_cleanup_call_list(link_t *lst) 500 496 { 501 497 while (!list_empty(lst)) { 502 call_t *call = list_get_instance(l ist_first(lst), call_t, link);498 call_t *call = list_get_instance(lst->next, call_t, link); 503 499 if (call->buffer) 504 500 free(call->buffer); … … 529 525 irq_spinlock_lock(&box->lock, true); 530 526 while (!list_empty(&box->connected_phones)) { 531 phone = list_get_instance( list_first(&box->connected_phones),527 phone = list_get_instance(box->connected_phones.next, 532 528 phone_t, link); 533 529 if (SYNCH_FAILED(mutex_trylock(&phone->lock))) { … … 609 605 /* Wait for all answers to interrupted synchronous calls to arrive */ 610 606 ipl_t ipl = interrupts_disable(); 611 while (!list_empty(&TASK->sync_box es)) {612 answerbox_t *box = list_get_instance( 613 list_first(&TASK->sync_boxes),answerbox_t, sync_box_link);607 while (!list_empty(&TASK->sync_box_head)) { 608 answerbox_t *box = list_get_instance(TASK->sync_box_head.next, 609 answerbox_t, sync_box_link); 614 610 615 611 list_remove(&box->sync_box_link); … … 746 742 #endif 747 743 744 link_t *cur; 745 748 746 printf(" --- incomming calls ---\n"); 749 list_foreach(task->answerbox.calls, cur) { 747 for (cur = task->answerbox.calls.next; cur != &task->answerbox.calls; 748 cur = cur->next) { 750 749 call_t *call = list_get_instance(cur, call_t, link); 751 750 … … 767 766 768 767 printf(" --- dispatched calls ---\n"); 769 list_foreach(task->answerbox.dispatched_calls, cur) { 768 for (cur = task->answerbox.dispatched_calls.next; 769 cur != &task->answerbox.dispatched_calls; 770 cur = cur->next) { 770 771 call_t *call = list_get_instance(cur, call_t, link); 771 772 … … 787 788 788 789 printf(" --- incoming answers ---\n"); 789 list_foreach(task->answerbox.answers, cur) { 790 for (cur = task->answerbox.answers.next; 791 cur != &task->answerbox.answers; 792 cur = cur->next) { 790 793 call_t *call = list_get_instance(cur, call_t, link); 791 794
Note:
See TracChangeset
for help on using the changeset viewer.