Merge 'vm/merged/pinning-synch' into master #64

Merged
sb3923 merged 8 commits from vm/merged/pinning-synch into master 2024-12-06 16:31:38 +00:00
5 changed files with 37 additions and 32 deletions
Showing only changes of commit 22f3b0950f - Show all commits

View File

@@ -461,10 +461,9 @@ syscall_mmap (int fd, void *addr)
/* Check and ensure that there is enough space in the user virtual memory to
hold the entire file. */
for (off_t ofs = 0; ofs < file_size; ofs += PGSIZE)
{
if (page_get (thread_current (), addr + ofs) != NULL)
return MMAP_FAILURE;
}
/* Map the file data into the user virtual memory starting from addr. */
for (off_t ofs = 0; ofs < file_size; ofs += PGSIZE)
@@ -473,7 +472,7 @@ syscall_mmap (int fd, void *addr)
off_t zero_bytes = PGSIZE - read_bytes;
if (page_insert_file (file, ofs, addr + ofs, read_bytes, zero_bytes, true,
PAGE_FILE) == NULL)
PAGE_MMAP) == NULL)
return MMAP_FAILURE;
}
@@ -482,7 +481,6 @@ syscall_mmap (int fd, void *addr)
if (mmap == NULL)
return MMAP_FAILURE;
return mmap->mapping;
}