annotate user/lib/ipc.c3 @ 403:1613c9d479bf

Add top level build files
author Windel Bouwman
date Thu, 19 Feb 2015 12:17:05 +0100
parents 0fb6633c42f6
children 6aa9743ed362
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 {
402
0fb6633c42f6 Moved several files to logical locations
Windel Bouwman
parents: 315
diff changeset
23 var int x;
0fb6633c42f6 Moved several files to logical locations
Windel Bouwman
parents: 315
diff changeset
24 x=kernelTrap(MSG_SEND, 1, 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
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 313
diff changeset
27 function void receive_message(Msg *msg)
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
28 {
402
0fb6633c42f6 Moved several files to logical locations
Windel Bouwman
parents: 315
diff changeset
29 var int x;
0fb6633c42f6 Moved several files to logical locations
Windel Bouwman
parents: 315
diff changeset
30 x=kernelTrap(MSG_RECV, 2, 0);
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
31 }
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents:
diff changeset
32