Mercurial > lcfOS
annotate user/ipc.c3 @ 391:a139da1f44f6
Merge
author | Windel Bouwman |
---|---|
date | Fri, 16 May 2014 12:30:10 +0200 |
parents | 084cccaa5deb |
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 |