Remove the option to spawn_thread for an evq (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 12 Aug 2015 16:08:47 +0000 (12:08 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 28 Sep 2015 19:14:00 +0000 (15:14 -0400)
This is unused and unnecessary.  If an application wants a thread to
handle a message (and therefore in uthread context, which is what
spawn_thread provided), then just block a uthread on the event queue.
You don't need a 2LS op for that.

Technically this is a kernel header change.  Feel free to ignore it.

kern/include/ros/event.h
user/parlib/event.c
user/parlib/include/uthread.h

index ff64d25..86ca929 100644 (file)
@@ -27,7 +27,6 @@
 
 /* Flags from the program to the 2LS */
 #define EVENT_JUSTHANDLEIT             0x10000 /* 2LS should handle the ev_q */
-#define EVENT_THREAD                   0x20000 /* spawn thread to handle ev_q */
 
 /* Event Message Types */
 #define EV_NONE                                         0
index 27f7d8d..e3c58e8 100644 (file)
@@ -317,22 +317,13 @@ int handle_events(uint32_t vcoreid)
 void handle_event_q(struct event_queue *ev_q)
 {
        /* If the program wants to handle the ev_q on its own: */
-       if (ev_q->ev_flags & (EVENT_JUSTHANDLEIT | EVENT_THREAD)) {
+       if (ev_q->ev_flags & EVENT_JUSTHANDLEIT) {
                if (!ev_q->ev_handler) {
                        printf("No ev_handler installed for ev_q %08p, aborting!\n", ev_q);
                        return;
                }
-               if (ev_q->ev_flags & EVENT_JUSTHANDLEIT) {
-                       /* Remember this can't block or page fault */
-                       ev_q->ev_handler(ev_q);
-               } else if (ev_q->ev_flags & EVENT_THREAD) {
-                       /* 2LS sched op.  The 2LS can use an existing thread if it wants,
-                        * but do so inside spawn_thread() */
-                       if (sched_ops->spawn_thread)
-                               sched_ops->spawn_thread((uintptr_t)ev_q->ev_handler, ev_q);
-                       else
-                               printf("2LS can't spawn a thread for ev_q %08p\n", ev_q);
-               }
+               /* Remember this can't block or page fault */
+               ev_q->ev_handler(ev_q);
                return;
        }
        printd("[event] handling ev_q %08p on vcore %d\n", ev_q, vcore_id());
index 9bb71f8..d60273f 100644 (file)
@@ -52,7 +52,6 @@ struct schedule_ops {
                                                          unsigned long);
        /* Functions event handling wants */
        void (*preempt_pending)(void);
-       void (*spawn_thread)(uintptr_t pc_start, void *data);   /* don't run yet */
 };
 extern struct schedule_ops *sched_ops;