diff user/lib/ipc.c3 @ 402:0fb6633c42f6

Moved several files to logical locations
author Windel Bouwman
date Thu, 19 Feb 2015 00:13:07 +0100
parents user/ipc.c3@084cccaa5deb
children 6aa9743ed362
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/user/lib/ipc.c3	Thu Feb 19 00:13:07 2015 +0100
@@ -0,0 +1,32 @@
+
+module ipc;
+
+type struct {
+    int sender;
+    int cmd;
+    int data1;
+    int data2;
+    int data3;
+    int data4;
+} 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)
+{
+    var int x;
+    x=kernelTrap(MSG_SEND, 1, 0)
+}
+
+function void receive_message(Msg *msg)
+{
+    var int x;
+    x=kernelTrap(MSG_RECV, 2, 0);
+}
+