Mercurial > lcfOS
annotate user/ipc.c3 @ 313:04cf4d26a3bc
Added constant function
author | Windel Bouwman |
---|---|
date | Wed, 18 Dec 2013 18:02:26 +0100 |
parents | ff665880a6b0 |
children | 084cccaa5deb |
rev | line source |
---|---|
293 | 1 |
2 module ipc; | |
3 | |
313 | 4 type struct { |
5 int sender; | |
6 int data; | |
7 } Msg; | |
8 | |
9 const int MSG_SEND=1; | |
10 const int MSG_RECV=2; | |
11 | |
12 function int kernelTrap(int msgId, int a, int b) | |
13 { | |
14 // TODO: make this in assembler? | |
15 } | |
16 | |
311 | 17 function void SendMessage(Msg *msg) |
293 | 18 { |
313 | 19 kernelTrap(MSG_SEND, 1, 0) |
293 | 20 } |
21 | |
311 | 22 function void RecvMessage(Msg msg) |
293 | 23 { |
313 | 24 kernelTrap(MSG_RECV, 2, 0); |
293 | 25 } |
26 |