Beispiel #1
0
qword sys_leave(qword rsi, qword rdx, qword rcx, qword r8, qword r9) {
    if (getForegroundPid() == getCurrentPid()) {
        setForeground(1); // give forground to shell
    }
    changeProcessState(getCurrentPid(), DEAD);
    _yield();
    return 0;
}
Beispiel #2
0
int32_t
receive( uint32_t channelId, MESSAGE* msg, int32_t timeout )
{
	Task* t = getTask( getCurrentPid() );

	return channel_waitForMessage( channelId, t, timeout );
}
Beispiel #3
0
int32_t
channelSubscribe( uint32_t channelId )
{
	Task* t = getTask( getCurrentPid() );

	return channel_subscribe( channelId, t );
}
Beispiel #4
0
int32_t
sendrcv( uint32_t channelId, MESSAGE* msg, uint32_t timeout )
{
	Task* t = getTask( getCurrentPid() );

	if ( channel_receivesMessage( channelId, msg ) )
	{
		return 1;
	}

	return channel_waitForMessage( channelId, t, timeout );
}
Beispiel #5
0
qword sys_myPID(qword ans, qword rdx, qword rcx, qword r8, qword r9) {
    int * retPid = (int *) ans;
    *retPid = getCurrentPid();
    return 0;
}