Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1501 → Rev 1502

/kernel/trunk/generic/src/ipc/sysipc.c
502,16 → 502,16
*
* @param calldata Pointer to buffer where the call/answer data is stored
* @param usec Timeout. See waitq_sleep_timeout() for explanation.
* @param nonblocking See waitq_sleep_timeout() for explanation.
* @param flags Select mode of sleep operation. See waitq_sleep_timeout() for explanation.
*
* @return Callid, if callid & 1, then the call is answer
*/
__native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int nonblocking)
__native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int flags)
{
call_t *call;
 
restart:
call = ipc_wait_for_call(&TASK->answerbox, usec, nonblocking);
call = ipc_wait_for_call(&TASK->answerbox, usec, flags | SYNCH_FLAGS_INTERRUPTIBLE);
if (!call)
return 0;
 
/kernel/trunk/generic/src/ipc/ipc.c
142,7 → 142,7
request->callerbox = &sync_box;
 
ipc_call(phone, request);
ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING);
ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);
}
 
/** Answer message that was not dispatched and is not entered in
305,12 → 305,12
* @param box Answerbox expecting the call.
* @param usec Timeout in microseconds. See documentation for waitq_sleep_timeout() for
* decription of its special meaning.
* @param nonblocking Blocking vs. non-blocking operation mode switch. See documentation
* for waitq_sleep_timeout() for description of its special meaning.
* @param flags Select mode of sleep operation. See documentation for waitq_sleep_timeout()i
* for description of its special meaning.
* @return Recived message address
* - to distinguish between call and answer, look at call->flags
*/
call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int nonblocking)
call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int flags)
{
call_t *request;
ipl_t ipl;
317,7 → 317,7
int rc;
 
restart:
rc = waitq_sleep_timeout(&box->wq, usec, nonblocking);
rc = waitq_sleep_timeout(&box->wq, usec, flags);
if (SYNCH_FAILED(rc))
return NULL;
412,7 → 412,7
/* Wait for all async answers to arrive */
while (atomic_get(&task->active_calls)) {
call = ipc_wait_for_call(&task->answerbox, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING);
call = ipc_wait_for_call(&task->answerbox, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);
ASSERT((call->flags & IPC_CALL_ANSWERED) || (call->flags & IPC_CALL_NOTIF));
ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));