Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3369 → Rev 3370

/trunk/kernel/generic/include/ipc/ipc.h
293,7 → 293,7
extern call_t * ipc_wait_for_call(answerbox_t *, uint32_t, int);
extern void ipc_answer(answerbox_t *, call_t *);
extern int ipc_call(phone_t *, call_t *);
extern void ipc_call_sync(phone_t *, call_t *);
extern int ipc_call_sync(phone_t *, call_t *);
extern void ipc_phone_init(phone_t *);
extern void ipc_phone_connect(phone_t *, answerbox_t *);
extern void ipc_call_free(call_t *);
/trunk/kernel/generic/include/errno.h
56,6 → 56,7
#define EINVAL -13 /* Invalid value */
#define EBUSY -14 /* Resource is busy */
#define EOVERFLOW -15 /* The result does not fit its size. */
#define EINTR -16 /* Operation was interrupted. */
 
#endif
 
/trunk/kernel/generic/src/ipc/sysipc.c
442,7 → 442,9
IPC_SET_ARG5(call.data, 0);
 
if (!(res = request_preprocess(&call))) {
ipc_call_sync(phone, &call);
rc = ipc_call_sync(phone, &call);
if (rc != EOK)
return rc;
process_answer(&call);
} else {
IPC_SET_RETVAL(call.data, res);
480,7 → 482,9
GET_CHECK_PHONE(phone, phoneid, return ENOENT);
 
if (!(res = request_preprocess(&call))) {
ipc_call_sync(phone, &call);
rc = ipc_call_sync(phone, &call);
if (rc != EOK)
return rc;
process_answer(&call);
} else
IPC_SET_RETVAL(call.data, res);
/trunk/kernel/generic/src/ipc/ipc.c
171,8 → 171,10
*
* @param phone Destination kernel phone structure.
* @param request Call structure with request.
*
* @return EOK on success or EINTR if the sleep was interrupted.
*/
void ipc_call_sync(phone_t *phone, call_t *request)
int ipc_call_sync(phone_t *phone, call_t *request)
{
answerbox_t sync_box;
 
182,7 → 184,10
request->callerbox = &sync_box;
 
ipc_call(phone, request);
ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);
if (!ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT,
SYNCH_FLAGS_INTERRUPTIBLE))
return EINTR;
return EOK;
}
 
/** Answer a message which was not dispatched and is not listed in any queue.