Implement dynamic stack growth #54

Merged
td1223 merged 14 commits from ethan-stack-growth into virtual-memory 2024-11-30 23:21:34 +00:00
28 changed files with 316 additions and 863 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;
}
}