projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integrate struct addrspace into struct thread.
[pintos-anon]
/
src
/
threads
/
thread.h
diff --git
a/src/threads/thread.h
b/src/threads/thread.h
index 4d65e1bdf68980b8d7cfcbd9150162eacf466084..c4520580fcbca7b20bc1596eeb7bcc538db06d10 100644
(file)
--- a/
src/threads/thread.h
+++ b/
src/threads/thread.h
@@
-19,27
+19,34
@@
enum thread_status
struct thread
{
struct thread
{
- enum thread_status status;
- char name[16];
- uint8_t *stack;
- list_elem rq_elem;
+ /* 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
#ifdef USERPROG
- struct addrspace addrspace;
+ /* These members are owned by the addrspace_*() functions. */
+ uint32_t *pagedir; /* Page directory. */
#endif
#endif
+
+ /* Marker to detect stack overflow. */
+ unsigned magic; /* Always set to THREAD_MAGIC. */
};
};
-void thread_init (const char *name, void (*) (void *aux), void *) NO_RETURN;
-struct thread *thread_create (const char *name, void (*) (void *aux), void *);
-void thread_destroy (struct thread *);
-struct thread *thread_current (void);
+void thread_init (void);
+void thread_start (void) NO_RETURN;
+struct thread *thread_create (const char *name, void (*) (void *aux), void *);
#ifdef USERPROG
bool thread_execute (const char *filename);
#endif
#ifdef USERPROG
bool thread_execute (const char *filename);
#endif
-void thread_
ready
(struct thread *);
-
void thread_exit (void) NO_RETURN
;
+void thread_
wake
(struct thread *);
+
const char *thread_name (struct thread *)
;
+struct thread *thread_current (void);
+void thread_exit (void) NO_RETURN;
void thread_yield (void);
void thread_sleep (void);
void thread_yield (void);
void thread_sleep (void);