From fa2fb4a711cbe6d63b4944481b57856fde9608bd Mon Sep 17 00:00:00 2001 From: sBubshait Date: Wed, 13 Nov 2024 18:48:23 +0000 Subject: [PATCH] Refactor system call comments for accuracy and grammar --- src/userprog/syscall.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index a85fc2b..29231f3 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -91,7 +91,7 @@ syscall_init (void) lock_init (&filesys_lock); } -/* Function that takes a interrupt frame containing a syscall and its args. +/* Function that takes an interrupt frame containing a syscall and its args. Validates the arguments and pointers before calling the relevant high-level system call function, storing its output (if any) in f->eax */ static void @@ -138,8 +138,7 @@ syscall_exit (int status) } /* Executes a given command with the relevant args, by calling process_execute. - Returns PID for the process that is running the CMD_LINE - */ + Returns PID for the process that is running the CMD_LINE. */ static pid_t syscall_exec (const char *cmd_line) { @@ -416,8 +415,8 @@ fd_get_file (int fd) } /* Validates if a block of memory starting at START and of size SIZE bytes is - fully contained within user virtual memory. Kills the thread (by calling - thread_exit) if the memory is invalid. Otherwise, returns (nothing) normally. + fully contained within user virtual memory. Kills the thread (by exiting with + failure) if the memory is invalid. Otherwise, returns (nothing) normally. If the size is 0, the function does no checks and returns the given ptr. */ static void validate_user_pointer (const void *start, size_t size) @@ -438,7 +437,7 @@ validate_user_pointer (const void *start, size_t size) } /* Validates if a string is fully contained within user virtual memory. Kills - the thread (by calling thread_exit) if the memory is invalid. Otherwise, + the thread (by exiting with failure) if the memory is invalid. Otherwise, returns (nothing) normally. */ static void validate_user_string (const char *str)