From: Ben Pfaff Date: Wed, 29 Sep 2004 01:04:09 +0000 (+0000) Subject: Comments. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80285644c64dc9cbbc86a250e266846e4bd385e8;p=pintos-anon Comments. --- diff --git a/src/threads/interrupt.h b/src/threads/interrupt.h index adb7fa9..d54b7ef 100644 --- a/src/threads/interrupt.h +++ b/src/threads/interrupt.h @@ -41,7 +41,7 @@ struct intr_frame /* Pushed by the CPU. These are the interrupted task's saved registers. */ - void (*eip) (void); /* Current or next instruction. */ + void (*eip) (void); /* Next instruction to execute. */ uint16_t cs, :16; /* Code segment for eip. */ uint32_t eflags; /* Saved CPU flags. */ void *esp; /* Saved stack pointer. */ diff --git a/src/threads/palloc.h b/src/threads/palloc.h index ba6aa74..2d41cf6 100644 --- a/src/threads/palloc.h +++ b/src/threads/palloc.h @@ -3,6 +3,7 @@ #include +/* How to allocate pages. */ enum palloc_flags { PAL_ASSERT = 001, /* Panic on failure. */ diff --git a/src/threads/switch.h b/src/threads/switch.h index 07b805e..084a794 100644 --- a/src/threads/switch.h +++ b/src/threads/switch.h @@ -19,6 +19,7 @@ struct switch_threads_frame NEXT's context. */ struct thread *switch_threads (struct thread *cur, struct thread *next); +/* Stack frame for switch_entry(). */ struct switch_entry_frame { void (*eip) (void); diff --git a/src/threads/synch.c b/src/threads/synch.c index 85af57d..a892454 100644 --- a/src/threads/synch.c +++ b/src/threads/synch.c @@ -250,7 +250,7 @@ cond_init (struct condition *cond, const char *name) } /* Atomically releases LOCK and waits for COND to be signaled by - some other piece of code. After COND is signalled, LOCK is + some other piece of code. After COND is signaled, LOCK is reacquired before returning. LOCK must be held before calling this function. @@ -261,7 +261,7 @@ cond_init (struct condition *cond, const char *name) again. A given condition variable is associated with only a single - lock, but one lock may be be associated with any number of + lock, but one lock may be associated with any number of condition variables. That is, there is a one-to-many mapping from locks to condition variables. diff --git a/src/threads/synch.h b/src/threads/synch.h index ad84238..c13f95d 100644 --- a/src/threads/synch.h +++ b/src/threads/synch.h @@ -12,7 +12,7 @@ struct semaphore struct list waiters; /* List of waiting threads. */ }; -void sema_init (struct semaphore *, unsigned value, const char *); +void sema_init (struct semaphore *, unsigned value, const char *name); void sema_down (struct semaphore *); void sema_up (struct semaphore *); const char *sema_name (const struct semaphore *); @@ -25,7 +25,7 @@ struct lock struct semaphore semaphore; /* Binary semaphore controlling access. */ }; -void lock_init (struct lock *, const char *); +void lock_init (struct lock *, const char *name); void lock_acquire (struct lock *); void lock_release (struct lock *); bool lock_held_by_current_thread (const struct lock *); @@ -38,7 +38,7 @@ struct condition struct list waiters; /* List of waiting threads. */ }; -void cond_init (struct condition *, const char *); +void cond_init (struct condition *, const char *name); void cond_wait (struct condition *, struct lock *); void cond_signal (struct condition *, struct lock *); void cond_broadcast (struct condition *, struct lock *);