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 78 additions and 125 deletions
Showing only changes of commit e718159ed8 - Show all commits

View File

@@ -34,7 +34,7 @@ static const syscall_arguments syscall_lookup[] = {
/* The number of syscall functions (i.e, number of elements) within the
syscall_lookup table. */
static const int lookup_size
static const int LOOKUP_SIZE
= sizeof (syscall_lookup) / sizeof (syscall_arguments);
void
@@ -51,7 +51,7 @@ syscall_handler (struct intr_frame *f)
int syscall_number = *(int *) f->esp;
/* Ensures the number corresponds to a system call that can be handled. */
if (syscall_number < 0 || syscall_number >= lookup_size)
if (syscall_number < 0 || syscall_number >= LOOKUP_SIZE)
thread_exit ();
syscall_arguments syscall = syscall_lookup[syscall_number];