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
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
1
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
2 module ipc;
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
3
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
4 type struct {
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
5 int sender;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
6 int data;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
7 } Msg;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
8
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
9 const int MSG_SEND=1;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
10 const int MSG_RECV=2;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
11
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
12 function int kernelTrap(int msgId, int a, int b)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
13 {
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
14 // TODO: make this in assembler?
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
15 }
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
16
311
ff665880a6b0 Added testcase for kernel and userspace
Windel Bouwman
parents: 293
diff changeset
17 function void SendMessage(Msg *msg)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
18 {
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
19 kernelTrap(MSG_SEND, 1, 0)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
20 }
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
21
311
ff665880a6b0 Added testcase for kernel and userspace
Windel Bouwman
parents: 293
diff changeset
22 function void RecvMessage(Msg msg)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
23 {
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
24 kernelTrap(MSG_RECV, 2, 0);
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
25 }
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
26