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