Rev 1040 | Rev 1072 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1040 | Rev 1050 | ||
|---|---|---|---|
| Line 182... | Line 182... | ||
| 182 | */ |
182 | */ |
| 183 | void ipc_answer(answerbox_t *box, call_t *request) |
183 | void ipc_answer(answerbox_t *box, call_t *request) |
| 184 | { |
184 | { |
| 185 | answerbox_t *callerbox = request->callerbox; |
185 | answerbox_t *callerbox = request->callerbox; |
| 186 | 186 | ||
| - | 187 | request->flags &= ~IPC_CALL_DISPATCHED; |
|
| 187 | request->flags |= IPC_CALL_ANSWERED; |
188 | request->flags |= IPC_CALL_ANSWERED; |
| 188 | 189 | ||
| 189 | spinlock_lock(&box->lock); |
190 | spinlock_lock(&box->lock); |
| 190 | list_remove(&request->list); |
191 | list_remove(&request->list); |
| 191 | spinlock_unlock(&box->lock); |
192 | spinlock_unlock(&box->lock); |
| Line 215... | Line 216... | ||
| 215 | /* Handle requests */ |
216 | /* Handle requests */ |
| 216 | request = list_get_instance(box->calls.next, call_t, list); |
217 | request = list_get_instance(box->calls.next, call_t, list); |
| 217 | list_remove(&request->list); |
218 | list_remove(&request->list); |
| 218 | /* Append request to dispatch queue */ |
219 | /* Append request to dispatch queue */ |
| 219 | list_append(&request->list, &box->dispatched_calls); |
220 | list_append(&request->list, &box->dispatched_calls); |
| - | 221 | request->flags |= IPC_CALL_DISPATCHED; |
|
| 220 | } else { |
222 | } else { |
| 221 | if (!(flags & IPC_WAIT_NONBLOCKING)) { |
223 | if (!(flags & IPC_WAIT_NONBLOCKING)) { |
| 222 | /* Wait for event to appear */ |
224 | /* Wait for event to appear */ |
| 223 | spinlock_unlock(&box->lock); |
225 | spinlock_unlock(&box->lock); |
| 224 | waitq_sleep(&box->wq); |
226 | waitq_sleep(&box->wq); |