Implement Supplemental Page Table (SPT) per thread along with structure for its entries, w/ G
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "threads/switch.h"
|
||||
#include "threads/synch.h"
|
||||
#include "threads/vaddr.h"
|
||||
#include "vm/page.h"
|
||||
#ifdef USERPROG
|
||||
#include "userprog/process.h"
|
||||
#include "userprog/syscall.h"
|
||||
@@ -264,7 +265,8 @@ thread_create (const char *name, int priority,
|
||||
|
||||
if (!hash_init (&t->open_files, fd_hash, fd_less, NULL)
|
||||
|| !hash_init (&t->child_results, process_result_hash,
|
||||
process_result_less, t))
|
||||
process_result_less, t)
|
||||
|| !hash_init (&t->pages, page_hash, page_less, NULL))
|
||||
{
|
||||
palloc_free_page (t);
|
||||
free (t->result);
|
||||
|
||||
@@ -135,6 +135,8 @@ 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. */
|
||||
|
||||
Reference in New Issue
Block a user