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