summaryrefslogtreecommitdiffstats
path: root/src/userprog/syscall.c
diff options
context:
space:
mode:
authorFelipe Boeira <felipe.boeira@liu.se>2019-01-08 18:39:03 +0100
committerFelipe Boeira <felipe.boeira@liu.se>2019-01-08 18:39:03 +0100
commitd4522b8e9854178473adcea0fbb84f23f6e744bd (patch)
treefbcf620617c5023154eba3f965b3a982daa64a47 /src/userprog/syscall.c
downloadpintos-d4522b8e9854178473adcea0fbb84f23f6e744bd.tar.gz
Initial commit
Diffstat (limited to 'src/userprog/syscall.c')
-rw-r--r--src/userprog/syscall.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c
new file mode 100644
index 0000000..370c89b
--- /dev/null
+++ b/src/userprog/syscall.c
@@ -0,0 +1,20 @@
+#include "userprog/syscall.h"
+#include <stdio.h>
+#include <syscall-nr.h>
+#include "threads/interrupt.h"
+#include "threads/thread.h"
+
+static void syscall_handler (struct intr_frame *);
+
+void
+syscall_init (void)
+{
+ intr_register_int (0x30, 3, INTR_ON, syscall_handler, "syscall");
+}
+
+static void
+syscall_handler (struct intr_frame *f UNUSED)
+{
+ printf ("system call!\n");
+ thread_exit ();
+}