X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fdevices%2Fintq.c;h=40b23ae6a48fe5bd0dfd3d1ed65b9ad97c31c505;hp=8754c85034d2701d2a07f16dbd9cf48b76fe2673;hb=500278652b3d3ec6ba08c150e749b65ca4a5d208;hpb=eb718e3b5a5470b11e58dcc652f79e115272257a diff --git a/src/devices/intq.c b/src/devices/intq.c index 8754c85..40b23ae 100644 --- a/src/devices/intq.c +++ b/src/devices/intq.c @@ -6,12 +6,11 @@ static int next (int pos); static void wait (struct intq *q, struct thread **waiter); static void signal (struct intq *q, struct thread **waiter); -/* Initializes interrupt queue Q, naming it NAME (for debugging - purposes). */ +/* Initializes interrupt queue Q. */ void -intq_init (struct intq *q, const char *name) +intq_init (struct intq *q) { - lock_init (&q->lock, name); + lock_init (&q->lock); q->not_full = q->not_empty = NULL; q->head = q->tail = 0; } @@ -33,9 +32,8 @@ intq_full (const struct intq *q) } /* Removes a byte from Q and returns it. - Q must not be empty if called from an interrupt handler. - Otherwise, if Q is empty, first sleeps until a byte is - added. */ + If Q is empty, sleeps until a byte is added. + When called from an interrupt handler, Q must not be empty. */ uint8_t intq_getc (struct intq *q) { @@ -57,9 +55,8 @@ intq_getc (struct intq *q) } /* Adds BYTE to the end of Q. - Q must not be full if called from an interrupt handler. - Otherwise, if Q is full, first sleeps until a byte is - removed. */ + If Q is full, sleeps until a byte is removed. + When called from an interrupt handler, Q must not be full. */ void intq_putc (struct intq *q, uint8_t byte) { @@ -87,7 +84,7 @@ next (int pos) /* WAITER must be the address of Q's not_empty or not_full member. Waits until the given condition is true. */ static void -wait (struct intq *q, struct thread **waiter) +wait (struct intq *q UNUSED, struct thread **waiter) { ASSERT (!intr_context ()); ASSERT (intr_get_level () == INTR_OFF); @@ -103,7 +100,7 @@ wait (struct intq *q, struct thread **waiter) thread is waiting for the condition, wakes it up and resets the waiting thread. */ static void -signal (struct intq *q, struct thread **waiter) +signal (struct intq *q UNUSED, struct thread **waiter) { ASSERT (intr_get_level () == INTR_OFF); ASSERT ((waiter == &q->not_empty && !intq_empty (q))