Refactor stack growth #57

Merged
sb3923 merged 17 commits from vm/stack-growth/saleh into vm/virtual-memory/saleh 2024-12-05 00:53:35 +00:00
26 changed files with 313 additions and 702 deletions
Showing only changes of commit 59e7a64f8e - Show all commits

View File

@@ -421,7 +421,8 @@ validate_user_pointer (const void *ptr, size_t size, bool check_write)
void *last = ptr + size - 1;
if (!is_user_vaddr (last))
thread_exit ();
for (; ptr <= last; ptr++)
ptr = pg_round_down (ptr);
while (ptr <= last)
{
int result;
/* Check read access to pointer. */
@@ -430,6 +431,7 @@ validate_user_pointer (const void *ptr, size_t size, bool check_write)
/* Check write access to pointer (if required). */
if (check_write && !put_user (ptr, result))
thread_exit ();
ptr += PGSIZE;
}
}