summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-06-24 00:34:51 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-17 23:50:17 +0200
commit5567333f528c8be2ce80a111e637652458f584b4 (patch)
tree43c8d7e3c177f7f7c097e82f5efa4d2a628f7fc8
parente7dd1cef1ddadd01df093bf0ebbccc2515ed7c2d (diff)
2002-06-23 Roland McGrath <roland@frob.com>
* kern/sched_prim.c (wait_hash): Macro replaced with static inline function. Use oskit_sreg_t instead of int.
-rw-r--r--kern/sched_prim.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index b3c60ada..6af03f16 100644
--- a/kern/sched_prim.c
+++ b/kern/sched_prim.c
@@ -152,9 +152,15 @@ void thread_check(thread_t, run_queue_t);
queue_head_t wait_queue[NUMQUEUES];
decl_simple_lock_data(, wait_lock[NUMQUEUES])
+#include <oskit/types.h>
+
/* NOTE: we want a small positive integer out of this */
-#define wait_hash(event) \
- ((((int)(event) < 0) ? ~(int)(event) : (int)(event)) % NUMQUEUES)
+static inline int
+wait_hash(event_t arg)
+{
+ oskit_sreg_t event = (oskit_sreg_t)arg;
+ return ((event < 0 ? ~event : event) % NUMQUEUES);
+}
void wait_queue_init(void)
{