diff options
author | neal <neal> | 2008-02-15 10:42:33 +0000 |
---|---|---|
committer | neal <neal> | 2008-02-15 10:42:33 +0000 |
commit | 1f3ce1628b8a1e3bd809c3d891b9b5d1dbdc311f (patch) | |
tree | c4a474c4083eada9a39b257cf3d1d3aa88cc14ae | |
parent | 5e34b1df467944267477f7b51c350f065eaf8fa6 (diff) |
2008-02-15 Neal H. Walfield <neal@gnu.org>
* folio.h (struct folio): Correctly calculate the size of
the wait_queues_p array.
(folio_object_wait_queue_p): Test the correct bit.
(folio_object_wait_queue_p_set): Set the correct bit.
-rw-r--r-- | hurd/ChangeLog | 7 | ||||
-rw-r--r-- | hurd/folio.h | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog index fd22332..e87f318 100644 --- a/hurd/ChangeLog +++ b/hurd/ChangeLog @@ -1,3 +1,10 @@ +2008-02-15 Neal H. Walfield <neal@gnu.org> + + * folio.h (struct folio): Correctly calculate the size of + the wait_queues_p array. + (folio_object_wait_queue_p): Test the correct bit. + (folio_object_wait_queue_p_set): Set the correct bit. + 2008-02-13 Neal H. Walfield <neal@gnu.org> * activity.h (RM_activity_stats): New definition. diff --git a/hurd/folio.h b/hurd/folio.h index 596fbba..f4cb29b 100644 --- a/hurd/folio.h +++ b/hurd/folio.h @@ -122,7 +122,7 @@ struct folio /* Bit array indicating whether the an object has a non-empty wait queue. */ - uint8_t wait_queues_p[(1 + FOLIO_OBJECTS + 8) / 8]; + uint8_t wait_queues_p[(1 + FOLIO_OBJECTS + (8 - 1)) / 8]; /* Head of the list of objects waiting for some event on this object. An element of this array is only valid if the @@ -217,7 +217,7 @@ folio_object_wait_queue_p (struct folio *folio, int object) { assert (object >= -1 && object <= FOLIO_OBJECTS); - return bit_test (folio->wait_queues_p, object); + return bit_test (folio->wait_queues_p, object + 1); } static inline void @@ -227,7 +227,7 @@ folio_object_wait_queue_p_set (struct folio *folio, int object, assert (object >= -1 && object <= FOLIO_OBJECTS); bit_set_to (folio->wait_queues_p, sizeof (folio->wait_queues_p), - object, valid); + object + 1, valid); } static inline oid_t |