#include <event.h>
#include <uthread.h>
-#ifdef __sparc_v8__
-# define udelay(x) udelay((x)/2000)
-#endif
-
mcs_barrier_t b;
__thread int temp;
void *core0_tls = 0;
struct event_queue *indirect_q;
-static void handle_generic(struct event_msg *ev_msg, unsigned int ev_type);
+static void handle_generic(struct event_msg *ev_msg, unsigned int ev_type,
+ void *data);
void ghetto_vcore_entry(void);
/* handle events: just want to print out what we get. This is just a
* quick set of handlers, not a registration for a kevent. */
for (int i = 0; i < MAX_NR_EVENT; i++)
- ev_handlers[i] = handle_generic;
+ register_ev_handler(i, handle_generic, 0);
/* Want to use the default ev_ev (which we just overwrote) */
- ev_handlers[EV_EVENT] = handle_ev_ev;
+ register_ev_handler(EV_EVENT, handle_ev_ev, 0);
/* vcore_init() done in vcore_request() now. */
/* Set up event reception. For example, this will allow us to receive an
* event and IPI for USER_IPIs on vcore 0. Check event.c for more stuff.
udelay(1000000);
//#endif
- /* test loop for restarting a notif_tf */
+ /* test loop for restarting a uthread_ctx */
if (vcoreid == 0) {
int ctr = 0;
while(1) {
return 0;
}
-static void handle_generic(struct event_msg *ev_msg, unsigned int ev_type)
+static void handle_generic(struct event_msg *ev_msg, unsigned int ev_type,
+ void *data)
{
printf("Got event type %d on vcore %d\n", ev_type, vcore_id());
}
assert(vcoreid == 0);
run_current_uthread();
}
- /* unmask notifications once you can let go of the notif_tf and it is okay
- * to clobber the transition stack.
+ /* unmask notifications once you can let go of the uthread_ctx and it is
+ * okay to clobber the transition stack.
* Check Documentation/processes.txt: 4.2.4. In real code, you should be
* popping the tf of whatever user process you want (get off the x-stack) */
enable_notifs(vcoreid);