Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1590 → Rev 1591

/kernel/trunk/generic/include/ipc/ipc.h
225,7 → 225,7
extern void task_print_list(void);
extern int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox);
void ipc_cleanup(void);
extern int ipc_phone_hangup(phone_t *phone, int aggressive);
int ipc_phone_hangup(phone_t *phone);
extern void ipc_backsend_err(phone_t *phone, call_t *call, __native err);
extern void ipc_print_task(task_id_t taskid);
 
/kernel/trunk/generic/src/ipc/sysipc.c
492,7 → 492,7
 
GET_CHECK_PHONE(phone, phoneid, return ENOENT);
 
if (ipc_phone_hangup(phone, 0))
if (ipc_phone_hangup(phone))
return -1;
 
return 0;
/kernel/trunk/generic/src/ipc/ipc.c
237,15 → 237,10
* lazily later.
*
* @param phone Phone to be hung up
* @param aggressive If false, the phone is only marked hungup, and all
* messages are allowed to complete.
* If true, all messages in all queues are discarded. There
* may still be some messages that will be 'in-transit' on
* other CPU.
*
* @return 0 - phone disconnected, -1 - the phone was already disconnected
*/
int ipc_phone_hangup(phone_t *phone, int aggressive)
int ipc_phone_hangup(phone_t *phone)
{
answerbox_t *box;
call_t *call;
271,10 → 266,6
}
}
 
if (aggressive && atomic_get(&phone->active_calls) > 0) {
/* TODO: Do some stuff be VERY aggressive */
}
 
phone->state = IPC_PHONE_HUNGUP;
spinlock_unlock(&phone->lock);
 
382,7 → 373,7
 
/* Disconnect all our phones ('ipc_phone_hangup') */
for (i=0;i < IPC_MAX_PHONES; i++)
ipc_phone_hangup(&TASK->phones[i], 1);
ipc_phone_hangup(&TASK->phones[i]);
 
/* Disconnect all connected irqs */
ipc_irq_cleanup(&TASK->answerbox);
421,8 → 412,13
atomic_get(&TASK->phones[i].active_calls) == 0)
TASK->phones[i].state = IPC_PHONE_FREE;
/* Just for sure, we might have had some
* IPC_PHONE_CONNECTING phones */
if (TASK->phones[i].state == IPC_PHONE_CONNECTED)
ipc_phone_hangup(&TASK->phones[i], 1);
ipc_phone_hangup(&TASK->phones[i]);
/* If the hangup succeeded, it has sent a HANGUP
* message, the IPC is now in HUNGUP state, we
* wait for the reply to come */
if (TASK->phones[i].state != IPC_PHONE_FREE)
break;
/kernel/trunk/generic/src/ipc/irq.c
215,6 → 215,10
 
if (irq_conns[irq].box) {
call = ipc_call_alloc(FRAME_ATOMIC);
if (!call) {
spinlock_unlock(&irq_conns[irq].lock);
return;
}
call->flags |= IPC_CALL_NOTIF;
IPC_SET_METHOD(call->data, IPC_M_INTERRUPT);
IPC_SET_ARG1(call->data, irq);