Refactor System Calls and Process for Readability; Change FD to local counter and use it as hash #47

Merged
sb3923 merged 9 commits from task2/refactoring/saleh into master 2024-11-15 16:41:13 +00:00
2 changed files with 64 additions and 16 deletions
Showing only changes of commit 82d45880f7 - Show all commits

View File

@@ -475,7 +475,7 @@ validate_user_pointer (const void *start, size_t size)
/* We now need to check if the entire memory block is mapped to physical /* We now need to check if the entire memory block is mapped to physical
memory by the page table. */ memory by the page table. */
for (const void *ptr = start; ptr <= end; ptr += PGSIZE) for (const void *ptr = pg_round_down (start); ptr <= end; ptr += PGSIZE)
if (pagedir_get_page (thread_current ()->pagedir, ptr) == NULL) if (pagedir_get_page (thread_current ()->pagedir, ptr) == NULL)
syscall_exit (EXIT_FAILURE); syscall_exit (EXIT_FAILURE);
} }