Fixes preempt/indir tracing in lock_test
[akaros.git] / user / benchutil / alarm_dispatch.c
index d34d5fb..56e417c 100644 (file)
@@ -21,7 +21,8 @@ struct {
 } dispatch;
 
 /* Dispatch the alarm event to its proper handler */
-static void dispatch_alarm(struct event_msg *ev_msg, unsigned int ev_type)
+static void dispatch_alarm(struct event_msg *ev_msg, unsigned int ev_type,
+                           void *data)
 {
        assert(ev_type == EV_ALARM);
        if (ev_msg) {
@@ -29,7 +30,7 @@ static void dispatch_alarm(struct event_msg *ev_msg, unsigned int ev_type)
                // deregistering its handler.  Make sure you do this properly.
                handle_event_t handler = dispatch.handlers[ev_msg->ev_arg2];
                if (handler)
-                       handler(ev_msg, ev_type);
+                       handler(ev_msg, ev_type, data);
        }
 }
 
@@ -39,7 +40,7 @@ static void init_alarm_dispatch()
        spin_pdr_init(&dispatch.lock);
        dispatch.handlers = NULL;
        dispatch.length = 0;
-       ev_handlers[EV_ALARM] = dispatch_alarm;
+       register_ev_handler(EV_ALARM, dispatch_alarm, 0);
 }
 
 /* Grow the handler array if necessary.  The array lock must be held when