From e0cb66c611cd42d6a23eccec52ac74f22ea3479c Mon Sep 17 00:00:00 2001
From: Joshua Saxby <joshua.a.saxby@gmail.com>
Date: Tue, 3 Dec 2019 08:57:25 +0000
Subject: [PATCH] Declare credit for own work

---
 userprog/syscall_halt.c | 13 ++++++++++---
 userprog/system_calls.h |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/userprog/syscall_halt.c b/userprog/syscall_halt.c
index 1c36076..2698c31 100644
--- a/userprog/syscall_halt.c
+++ b/userprog/syscall_halt.c
@@ -1,6 +1,13 @@
+/*
+ * The Halt System Call
+ *
+ * Authored by Joshua Saxby
+ */
+#include "devices/shutdown.h"
 #include "system_calls.h"
 #include "threads/interrupt.h"
 
-void syscall_halt(struct intr_frame *f) {
-  (void*)0;
-}
\ No newline at end of file
+void syscall_halt(struct intr_frame *f UNUSED) {
+  // terminate Pintos right here and right now!
+  shutdown_power_off();
+}
diff --git a/userprog/system_calls.h b/userprog/system_calls.h
index 5d07273..c8b5518 100644
--- a/userprog/system_calls.h
+++ b/userprog/system_calls.h
@@ -2,7 +2,7 @@
 
 /*
  * Terminates Pintos by calling shutdown_power_off()
- * (declared in threads/init.h).
+ * (declared in devices/shutdown.h).
  */
 void syscall_halt(struct intr_frame *f);
 
@@ -32,4 +32,4 @@ void syscall_wait(struct intr_frame *f);
 /*
  * NOTE: There are more system calls implemented by Pintos but we are not
  * implementing them because the assignment brief does not ask of it.
- */
\ No newline at end of file
+ */
-- 
GitLab