114 |
error_t err; |
error_t err; |
115 |
l4_thread_id_t irq_handler_tid; |
l4_thread_id_t irq_handler_tid; |
116 |
pthread_t irq_handler; |
pthread_t irq_handler; |
117 |
|
l4_word_t result; |
118 |
|
|
119 |
irq_handler_tid = pthread_pool_get_np (); |
irq_handler_tid = pthread_pool_get_np (); |
120 |
if (irq_handler_tid == l4_nilthread) |
if (irq_handler_tid == l4_nilthread) |
121 |
panic ("Can not create the irq handler thread"); |
panic ("Can not create the kbd irq handler thread"); |
122 |
|
|
123 |
|
/* FIXME: We just tweak the scheduler so we can set the priority |
124 |
|
ourselves. */ |
125 |
|
result = wortel_thread_control (irq_handler_tid, irq_handler_tid, |
126 |
|
l4_myself (), l4_nilthread, (void *) -1); |
127 |
|
if (result) |
128 |
|
panic ("Can not set scheduler for kbd irq handler thread: %i", result); |
129 |
|
result = l4_set_priority (irq_handler_tid, /* FIXME */ 150); |
130 |
|
if (!result) |
131 |
|
panic ("Can not set priority for kbd irq handler thread: %i", result); |
132 |
|
|
133 |
err = pthread_create_from_l4_tid_np (&irq_handler, NULL, |
err = pthread_create_from_l4_tid_np (&irq_handler, NULL, |
134 |
irq_handler_tid, console_irq_handler, |
irq_handler_tid, console_irq_handler, |
135 |
dev); |
dev); |
136 |
if (err) |
if (err) |
137 |
panic ("Can not create the irq handler thread: %i", err); |
panic ("Can not create the kbd irq handler thread: %i", err); |
138 |
|
|
139 |
pthread_detach (irq_handler); |
pthread_detach (irq_handler); |
140 |
} |
} |