Subversion Repositories HelenOS-historic

Rev

Rev 1090 | Rev 1568 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1090 Rev 1141
Line 127... Line 127...
127
#include <ipc/ipcrsc.h>
127
#include <ipc/ipcrsc.h>
128
#include <debug.h>
128
#include <debug.h>
129
 
129
 
130
/** Find call_t * in call table according to callid
130
/** Find call_t * in call table according to callid
131
 *
131
 *
-
 
132
 * TODO: Some speedup (hash table?)
132
 * @return NULL on not found, otherwise pointer to call structure
133
 * @return NULL on not found, otherwise pointer to call structure
133
 */
134
 */
134
call_t * get_call(__native callid)
135
call_t * get_call(__native callid)
135
{
136
{
-
 
137
    link_t *lst;
-
 
138
    call_t *call, *result = NULL;
-
 
139
 
-
 
140
    spinlock_lock(&TASK->answerbox.lock);
136
    /* TODO: Traverse list of dispatched calls and find one */
141
    for (lst = TASK->answerbox.dispatched_calls.next;
137
    /* TODO: locking of call, ripping it from dispatched calls etc.  */
142
         lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
-
 
143
        call = list_get_instance(lst, call_t, list);
-
 
144
        if ((__native)call == callid) {
138
    return (call_t *) callid;
145
            result = call;
-
 
146
            break;
-
 
147
        }
-
 
148
    }
-
 
149
    spinlock_unlock(&TASK->answerbox.lock);
-
 
150
    return result;
139
}
151
}
140
 
152
 
141
/** Allocate new phone slot in current TASK structure */
153
/** Allocate new phone slot in current TASK structure */
142
int phone_alloc(void)
154
int phone_alloc(void)
143
{
155
{