Skip to content

Commit

Permalink
[#18] Implement halt system call
Browse files Browse the repository at this point in the history
Implementation of `halt ()` system call, using `power_off ()` defined in `threads/init.h`.
  • Loading branch information
Lment committed Apr 9, 2017
1 parent fd9af41 commit c9b5a7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/userprog/syscall.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "userprog/syscall.h"
#include <stdio.h>
#include <syscall-nr.h>
#include <debug.h>
#include "threads/interrupt.h"
#include "threads/thread.h"
#include "threads/synch.h"
#include "threads/init.h"

#define pid_t int

Expand Down Expand Up @@ -88,10 +90,12 @@ syscall_handler (struct intr_frame *f UNUSED)
}
}

/* Terminate pintos. */
static void
syscall_halt (void)
{

power_off ();
NOT_REACHED ();
}

static void
Expand Down

0 comments on commit c9b5a7a

Please sign in to comment.