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