1.1 --- a/pkg/devices/input/src/client/input-event-loop.cc Fri May 18 18:43:30 2018 +0200
1.2 +++ b/pkg/devices/input/src/client/input-event-loop.cc Fri May 18 22:34:51 2018 +0200
1.3 @@ -19,25 +19,10 @@
1.4 * Boston, MA 02110-1301, USA
1.5 */
1.6
1.7 -#include <l4/devices/input-event-loop.h>
1.8 -
1.9 -#include <pthread.h>
1.10 -#include <pthread-l4.h>
1.11 +#include "input-event-loop.h"
1.12
1.13 #include <l4/re/event>
1.14
1.15 -/* Main loop for event threads. */
1.16 -
1.17 -void *
1.18 -Input_event_loop::event_loop(void *data)
1.19 -{
1.20 - Input_event_loop *self = reinterpret_cast<Input_event_loop *>(data);
1.21 -
1.22 - while (1) self->handle();
1.23 -
1.24 - return 0;
1.25 -}
1.26 -
1.27 /* Handler for incoming interrupts signalling the presence of events. */
1.28
1.29 void
1.30 @@ -58,24 +43,9 @@
1.31 /* Event loop initiation. */
1.32
1.33 void
1.34 -Input_event_loop::start()
1.35 +Input_event_loop::start(l4_umword_t label)
1.36 {
1.37 - pthread_attr_t thread_attr;
1.38 - struct sched_param sp;
1.39 -
1.40 - /* Thread initialisation boilerplate. */
1.41 -
1.42 - if (pthread_attr_init(&thread_attr))
1.43 - return;
1.44 + Event_loop::start();
1.45
1.46 - sp.sched_priority = _priority;
1.47 - pthread_attr_setschedparam(&thread_attr, &sp);
1.48 - pthread_attr_setschedpolicy(&thread_attr, SCHED_L4);
1.49 - pthread_attr_setinheritsched(&thread_attr, PTHREAD_EXPLICIT_SCHED);
1.50 -
1.51 - /* Provide this instance as the private data. */
1.52 -
1.53 - pthread_create(&_pthread, &thread_attr, event_loop, this);
1.54 -
1.55 - _irq->bind_thread(Pthread::L4::cap(_pthread), 0xDEAD);
1.56 + _irq->bind_thread(Pthread::L4::cap(_pthread), label);
1.57 }