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
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;
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
6 int cmd;
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
7 int data1;
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
8 int data2;
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
9 int data3;
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
10 int data4;
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
11 } Msg;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
12
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
13 const int MSG_SEND=1;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
14 const int MSG_RECV=2;
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
15
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
16 function int kernelTrap(int msgId, int a, int b)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
17 {
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
18 // TODO: make this in assembler?
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
19 }
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
20
311
ff665880a6b0 Added testcase for kernel and userspace
Windel Bouwman
parents: 293
diff changeset
21 function void SendMessage(Msg *msg)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
22 {
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
23 kernelTrap(MSG_SEND, 1, 0)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
24 }
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
25
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
26 function void receive_message(Msg *msg)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
27 {
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 311
diff changeset
28 kernelTrap(MSG_RECV, 2, 0);
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
29 }
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
30