diff options
| author | manuel <manuel@mausz.at> | 2012-06-19 01:44:56 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-06-19 01:44:56 +0200 |
| commit | e88a8c4c379d721e9901752d440a05295087da11 (patch) | |
| tree | b89070c525614267811a10b77a4dbc49ffd96b03 /threads | |
| parent | d9e0c55d118d0a3923b440b7811f8d1d6db9e1d7 (diff) | |
| download | progos-e88a8c4c379d721e9901752d440a05295087da11.tar.gz progos-e88a8c4c379d721e9901752d440a05295087da11.tar.bz2 progos-e88a8c4c379d721e9901752d440a05295087da11.zip | |
implement page table and use it for lazy loading of segments
Diffstat (limited to 'threads')
| -rw-r--r-- | threads/synch.c | 8 | ||||
| -rw-r--r-- | threads/thread.c | 2 | ||||
| -rw-r--r-- | threads/thread.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/threads/synch.c b/threads/synch.c index a1b7549..a520f61 100644 --- a/threads/synch.c +++ b/threads/synch.c | |||
| @@ -32,9 +32,9 @@ | |||
| 32 | #include "threads/interrupt.h" | 32 | #include "threads/interrupt.h" |
| 33 | #include "threads/thread.h" | 33 | #include "threads/thread.h" |
| 34 | 34 | ||
| 35 | static bool lock_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, | 35 | static bool lock_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, |
| 36 | void *AUX UNUSED); | 36 | void *AUX UNUSED); |
| 37 | static bool semaphore_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, | 37 | static bool semaphore_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, |
| 38 | void *aux UNUSED); | 38 | void *aux UNUSED); |
| 39 | 39 | ||
| 40 | /* Initializes semaphore SEMA to VALUE. A semaphore is a | 40 | /* Initializes semaphore SEMA to VALUE. A semaphore is a |
| @@ -202,7 +202,7 @@ lock_init (struct lock *lock) | |||
| 202 | 202 | ||
| 203 | /* comparison function for our descending ordered lock list. */ | 203 | /* comparison function for our descending ordered lock list. */ |
| 204 | static bool | 204 | static bool |
| 205 | lock_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, | 205 | lock_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, |
| 206 | void *AUX UNUSED) | 206 | void *AUX UNUSED) |
| 207 | { | 207 | { |
| 208 | const struct lock *l1 = list_entry (a, struct lock, elem); | 208 | const struct lock *l1 = list_entry (a, struct lock, elem); |
| @@ -355,7 +355,7 @@ cond_init (struct condition *cond) | |||
| 355 | 355 | ||
| 356 | /* comparison function for our descending ordered condition waiters list. */ | 356 | /* comparison function for our descending ordered condition waiters list. */ |
| 357 | static bool | 357 | static bool |
| 358 | semaphore_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, | 358 | semaphore_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, |
| 359 | void *aux UNUSED) | 359 | void *aux UNUSED) |
| 360 | { | 360 | { |
| 361 | const struct semaphore_elem *s1 = list_entry (a, struct semaphore_elem, elem); | 361 | const struct semaphore_elem *s1 = list_entry (a, struct semaphore_elem, elem); |
diff --git a/threads/thread.c b/threads/thread.c index cf404b6..14889ca 100644 --- a/threads/thread.c +++ b/threads/thread.c | |||
| @@ -73,7 +73,7 @@ static tid_t allocate_tid (void); | |||
| 73 | 73 | ||
| 74 | /* comparison function for our descending ordered ready list. */ | 74 | /* comparison function for our descending ordered ready list. */ |
| 75 | bool | 75 | bool |
| 76 | thread_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, | 76 | thread_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, |
| 77 | void *AUX UNUSED) | 77 | void *AUX UNUSED) |
| 78 | { | 78 | { |
| 79 | const struct thread *t1 = list_entry (a, struct thread, elem); | 79 | const struct thread *t1 = list_entry (a, struct thread, elem); |
diff --git a/threads/thread.h b/threads/thread.h index 9125937..293d14f 100644 --- a/threads/thread.h +++ b/threads/thread.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <debug.h> | 4 | #include <debug.h> |
| 5 | #include <list.h> | 5 | #include <list.h> |
| 6 | #include <hash.h> | ||
| 6 | #include <stdint.h> | 7 | #include <stdint.h> |
| 7 | #include "threads/synch.h" | 8 | #include "threads/synch.h" |
| 8 | 9 | ||
| @@ -112,6 +113,8 @@ struct thread | |||
| 112 | int saved_priority; /* saved base priority in case of priority dontation */ | 113 | int saved_priority; /* saved base priority in case of priority dontation */ |
| 113 | struct list locks; /* list of locks the thread currently holds */ | 114 | struct list locks; /* list of locks the thread currently holds */ |
| 114 | struct lock *blocked_lock; /* the lock the thread currently tries to acquire (but hasn't yet) */ | 115 | struct lock *blocked_lock; /* the lock the thread currently tries to acquire (but hasn't yet) */ |
| 116 | |||
| 117 | struct hash page_table; | ||
| 115 | }; | 118 | }; |
| 116 | 119 | ||
| 117 | /* If false (default), use round-robin scheduler. | 120 | /* If false (default), use round-robin scheduler. |
