Merge basic system calls with stack set-up infrastructure #27

Merged
td1223 merged 31 commits from user-programs into user-programs-stdout 2024-11-06 22:21:28 +00:00
2 changed files with 19 additions and 122 deletions
Showing only changes of commit fa6dac2108 - Show all commits

View File

@@ -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 ();
}