88 |
|
|
89 |
spin_unlock (&callout_list_lock); |
spin_unlock (&callout_list_lock); |
90 |
SPLON (spl); |
SPLON (spl); |
91 |
thread_sleep ((int) &callout_list, &callout_list_lock, |
thread_sleep ((int) &callout_list, 0, callout_continuation); |
|
callout_continuation); |
|
92 |
/* NOTREACHED */ |
/* NOTREACHED */ |
93 |
} |
} |
94 |
|
|
149 |
err = thread_create (TASK_KERNEL (), &callout_thread); |
err = thread_create (TASK_KERNEL (), &callout_thread); |
150 |
assert (err == KERN_SUCCESS); |
assert (err == KERN_SUCCESS); |
151 |
|
|
|
#if 1 |
|
152 |
thread_set_priority (callout_thread, THREAD_POLICY_FIFO, 0); |
thread_set_priority (callout_thread, THREAD_POLICY_FIFO, 0); |
|
#endif |
|
153 |
thread_start (callout_thread, callout_thread_fn, 0); |
thread_start (callout_thread, callout_thread_fn, 0); |
154 |
thread_setrun (callout_thread, false); |
thread_setrun (callout_thread, false); |
155 |
} |
} |
183 |
timer_interrupt (bool usermode_p) |
timer_interrupt (bool usermode_p) |
184 |
{ |
{ |
185 |
struct thread *thread = THREAD_CURRENT (); |
struct thread *thread = THREAD_CURRENT (); |
186 |
|
struct callout_entry *entry; |
187 |
bool preempt_p; |
bool preempt_p; |
188 |
|
|
189 |
#define CLOCK_RESOLUTION (1000000000 / HZ) |
#define CLOCK_RESOLUTION (1000000000 / HZ) |
203 |
|
|
204 |
if (! queue_empty (&callout_list)) |
if (! queue_empty (&callout_list)) |
205 |
{ |
{ |
|
struct callout_entry *entry; |
|
|
|
|
206 |
entry = (struct callout_entry *) queue_first (&callout_list); |
entry = (struct callout_entry *) queue_first (&callout_list); |
207 |
|
|
208 |
if (timestamp_count >= entry->timestamp) |
if (timestamp_count >= entry->timestamp) |