Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4537 → Rev 4439

/branches/dd/kernel/generic/src/ipc/sysipc.c
336,26 → 336,6
return 0;
}
 
static void phones_lock(phone_t *p1, phone_t *p2)
{
if (p1 < p2) {
mutex_lock(&p1->lock);
mutex_lock(&p2->lock);
} else if (p1 > p2) {
mutex_lock(&p2->lock);
mutex_lock(&p1->lock);
} else {
mutex_lock(&p1->lock);
}
}
 
static void phones_unlock(phone_t *p1, phone_t *p2)
{
mutex_unlock(&p1->lock);
if (p1 != p2)
mutex_unlock(&p2->lock);
}
 
/** Called before the request is sent.
*
* @param call Call structure with the request.
375,10 → 355,20
phone_t *cloned_phone;
GET_CHECK_PHONE(cloned_phone, IPC_GET_ARG1(call->data),
return ENOENT);
phones_lock(cloned_phone, phone);
if (cloned_phone < phone) {
mutex_lock(&cloned_phone->lock);
mutex_lock(&phone->lock);
} else if (cloned_phone > phone) {
mutex_lock(&phone->lock);
mutex_lock(&cloned_phone->lock);
} else {
mutex_lock(&phone->lock);
}
if ((cloned_phone->state != IPC_PHONE_CONNECTED) ||
phone->state != IPC_PHONE_CONNECTED) {
phones_unlock(cloned_phone, phone);
if (cloned_phone != phone)
mutex_unlock(&cloned_phone->lock);
mutex_unlock(&phone->lock);
return EINVAL;
}
/*
389,12 → 379,16
*/
newphid = phone_alloc(phone->callee->task);
if (newphid < 0) {
phones_unlock(cloned_phone, phone);
if (cloned_phone != phone)
mutex_unlock(&cloned_phone->lock);
mutex_unlock(&phone->lock);
return ELIMIT;
}
ipc_phone_connect(&phone->callee->task->phones[newphid],
cloned_phone->callee);
phones_unlock(cloned_phone, phone);
if (cloned_phone != phone)
mutex_unlock(&cloned_phone->lock);
mutex_unlock(&phone->lock);
/* Set the new phone for the callee. */
IPC_SET_ARG1(call->data, newphid);
break;
/branches/dd/kernel/generic/src/ipc/event.c
64,8 → 64,8
}
}
 
static int event_subscribe(event_type_t evno, unative_t method,
answerbox_t *answerbox)
static int
event_subscribe(event_type_t evno, unative_t method, answerbox_t *answerbox)
{
if (evno >= EVENT_END)
return ELIMIT;
122,7 → 122,8
}
}
 
void event_notify(event_type_t evno, unative_t a1, unative_t a2, unative_t a3,
void
event_notify(event_type_t evno, unative_t a1, unative_t a2, unative_t a3,
unative_t a4, unative_t a5)
{
ASSERT(evno < EVENT_END);