Implement halt system call w/ S.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include "userprog/syscall.h"
|
#include "userprog/syscall.h"
|
||||||
|
#include "devices/shutdown.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <syscall-nr.h>
|
#include <syscall-nr.h>
|
||||||
#include "threads/interrupt.h"
|
#include "threads/interrupt.h"
|
||||||
@@ -11,6 +12,9 @@ static void syscall_handler (struct intr_frame *);
|
|||||||
in size. */
|
in size. */
|
||||||
typedef uintptr_t syscall_function (uintptr_t, uintptr_t, uintptr_t);
|
typedef uintptr_t syscall_function (uintptr_t, uintptr_t, uintptr_t);
|
||||||
|
|
||||||
|
/* System Call Functions */
|
||||||
|
static void halt (void);
|
||||||
|
|
||||||
void
|
void
|
||||||
syscall_init (void)
|
syscall_init (void)
|
||||||
{
|
{
|
||||||
@@ -23,3 +27,9 @@ syscall_handler (struct intr_frame *f UNUSED)
|
|||||||
printf ("system call!\n");
|
printf ("system call!\n");
|
||||||
thread_exit ();
|
thread_exit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
halt (void)
|
||||||
|
{
|
||||||
|
shutdown_power_off ();
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user