Changeset ca687ad in mainline for generic/src/ipc/ipcrsc.c


Ignore:
Timestamp:
2006-03-31T13:53:36Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0cb56f5d
Parents:
296cc1b
Message:

Completed ipc_cleanup, it should be somehow integrated into
cleanup of task. The function can sleep.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ipc/ipcrsc.c

    r296cc1b rca687ad  
    130130/** Find call_t * in call table according to callid
    131131 *
     132 * TODO: Some speedup (hash table?)
    132133 * @return NULL on not found, otherwise pointer to call structure
    133134 */
    134135call_t * get_call(__native callid)
    135136{
    136         /* TODO: Traverse list of dispatched calls and find one */
    137         /* TODO: locking of call, ripping it from dispatched calls etc.  */
    138         return (call_t *) callid;
     137        link_t *lst;
     138        call_t *call, *result = NULL;
     139
     140        spinlock_lock(&TASK->answerbox.lock);
     141        for (lst = TASK->answerbox.dispatched_calls.next;
     142             lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
     143                call = list_get_instance(lst, call_t, list);
     144                if ((__native)call == callid) {
     145                        result = call;
     146                        break;
     147                }
     148        }
     149        spinlock_unlock(&TASK->answerbox.lock);
     150        return result;
    139151}
    140152
Note: See TracChangeset for help on using the changeset viewer.