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