X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fthreads%2Fthread.h;h=1dfde5ac9b03867f94a545f08cc2a7bb2ac83435;hb=5fbedf1d20c2b2f2dbc8c7ebd64cc7b4812a44bf;hp=5cfbadfbfb303bc2fbb69ecf6a72e85732803dbc;hpb=6bae0ee083ed3ef0a1df7e892c6509e47a0ad2dc;p=pintos-anon diff --git a/src/threads/thread.h b/src/threads/thread.h index 5cfbadf..1dfde5a 100644 --- a/src/threads/thread.h +++ b/src/threads/thread.h @@ -19,20 +19,26 @@ enum thread_status struct thread { + /* These members are owned by the thread_*() functions. */ enum thread_status status; /* Thread state. */ char name[16]; /* Name (for debugging purposes). */ uint8_t *stack; /* Saved stack pointer. */ list_elem rq_elem; /* Run queue list element. */ + #ifdef USERPROG - struct addrspace addrspace; /* Userland address space. */ + /* These members are owned by the addrspace_*() functions. */ + uint32_t *pagedir; /* Page directory. */ #endif + + /* Marker to detect stack overflow. */ unsigned magic; /* Always set to THREAD_MAGIC. */ }; void thread_init (void); void thread_start (void) NO_RETURN; -struct thread *thread_create (const char *name, void (*) (void *aux), void *); +typedef void thread_func (void *aux); +struct thread *thread_create (const char *name, thread_func *, void *); #ifdef USERPROG bool thread_execute (const char *filename); #endif