view user/ipc.c3 @ 313:04cf4d26a3bc

Added constant function
author Windel Bouwman
date Wed, 18 Dec 2013 18:02:26 +0100
parents ff665880a6b0
children 084cccaa5deb
line wrap: on
line source


module ipc;

type struct {
    int sender;
    int data;
} Msg;

const int MSG_SEND=1;
const int MSG_RECV=2;

function int kernelTrap(int msgId, int a, int b)
{
    // TODO: make this in assembler?
}

function void SendMessage(Msg *msg)
{
    kernelTrap(MSG_SEND, 1, 0)
}

function void RecvMessage(Msg msg)
{
    kernelTrap(MSG_RECV, 2, 0);
}