Merge branch 'vm/page-swap-synch' into vm/shared-read-only-executables

This commit is contained in:
2024-12-05 02:12:12 +00:00
15 changed files with 446 additions and 135 deletions

View File

@@ -265,10 +265,14 @@ thread_create (const char *name, int priority,
/* Initialize the thread's file descriptor table. */
t->fd_counter = MINIMUM_USER_FD;
if (!hash_init (&t->open_files, fd_hash, fd_less, NULL)
|| !hash_init (&t->child_results, process_result_hash,
process_result_less, t)
|| !init_pages (t))
bool success = hash_init (&t->open_files, fd_hash, fd_less, NULL);
success = success && hash_init (&t->child_results, process_result_hash,
process_result_less, t);
#ifdef VM
success = success && init_pages (t);
#endif
if (!success)
{
palloc_free_page (t);
free (t->result);

View File

@@ -135,8 +135,6 @@ struct thread
/* Shared between thread.c and synch.c. */
struct list_elem elem; /* List element. */
struct hash pages; /* Table of open user pages. */
#ifdef USERPROG
/* Owned by userprog/process.c. */
uint32_t *pagedir; /* Page directory. */
@@ -145,6 +143,12 @@ struct thread
struct hash open_files; /* Hash Table of FD -> Struct File. */
#endif
#ifdef VM
struct hash pages; /* Table of open user pages. */
#endif
void *curr_esp;
/* Owned by thread.c. */
unsigned magic; /* Detects stack overflow. */
};