diff --git a/userprog/syscall_halt.c b/userprog/syscall_halt.c index 1c3607681df736f94eb15186f651d1123ec31b69..2698c31feafc6afc322f955a021938e95e259937 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 5d0727352769f8cdeec4775eef41c6d893f16045..c8b55188d39c5f70ddb72d15d790c69be3678ec5 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 + */