diff user/ipc.c3 @ 313:04cf4d26a3bc

Added constant function
author Windel Bouwman
date Wed, 18 Dec 2013 18:02:26 +0100
parents ff665880a6b0
children 084cccaa5deb
line wrap: on
line diff
--- a/user/ipc.c3	Mon Dec 16 17:58:15 2013 +0100
+++ b/user/ipc.c3	Wed Dec 18 18:02:26 2013 +0100
@@ -1,13 +1,26 @@
 
 module ipc;
 
+type struct {
+    int sender;
+    int data;
+} Msg;
+
+const int MSG_SEND=1;
+const int MSG_RECV=2;
+
+function int kernelTrap(int msgId, int a, int b)
+{
+    // TODO: make this in assembler?
+}
+
 function void SendMessage(Msg *msg)
 {
-    kernelTrap(MSG_SEND, msg)
+    kernelTrap(MSG_SEND, 1, 0)
 }
 
 function void RecvMessage(Msg msg)
 {
-    kernelTrap(MSG_RECV, msg);
+    kernelTrap(MSG_RECV, 2, 0);
 }