From e88a8c4c379d721e9901752d440a05295087da11 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 19 Jun 2012 01:44:56 +0200 Subject: implement page table and use it for lazy loading of segments --- threads/synch.c | 8 ++++---- threads/thread.c | 2 +- threads/thread.h | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'threads') 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 @@ #include "threads/interrupt.h" #include "threads/thread.h" -static bool lock_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, +static bool lock_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, void *AUX UNUSED); -static bool semaphore_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, +static bool semaphore_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, void *aux UNUSED); /* Initializes semaphore SEMA to VALUE. A semaphore is a @@ -202,7 +202,7 @@ lock_init (struct lock *lock) /* comparison function for our descending ordered lock list. */ static bool -lock_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, +lock_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, void *AUX UNUSED) { const struct lock *l1 = list_entry (a, struct lock, elem); @@ -355,7 +355,7 @@ cond_init (struct condition *cond) /* comparison function for our descending ordered condition waiters list. */ static bool -semaphore_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, +semaphore_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, void *aux UNUSED) { 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); /* comparison function for our descending ordered ready list. */ bool -thread_priority_cmp_greater(const struct list_elem *a, const struct list_elem *b, +thread_priority_cmp_greater (const struct list_elem *a, const struct list_elem *b, void *AUX UNUSED) { 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 @@ #include #include +#include #include #include "threads/synch.h" @@ -112,6 +113,8 @@ struct thread int saved_priority; /* saved base priority in case of priority dontation */ struct list locks; /* list of locks the thread currently holds */ struct lock *blocked_lock; /* the lock the thread currently tries to acquire (but hasn't yet) */ + + struct hash page_table; }; /* If false (default), use round-robin scheduler. -- cgit v1.2.3