Ktasks are run with interrupts enabled
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 21 Jan 2014 07:23:13 +0000 (23:23 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 21 Jan 2014 19:04:03 +0000 (11:04 -0800)
In general, I think most ktasks should have IRQs enabled.  If not,
disable them (temporarily) when needed.

kern/src/kthread.c

index e7666ea..a6b8889 100644 (file)
@@ -187,7 +187,9 @@ static void __ktask_wrapper(uint32_t srcid, long a0, long a1, long a2)
        struct per_cpu_info *pcpui = &per_cpu_info[core_id()];
        assert(pcpui->cur_kthread->is_ktask);
        pcpui->cur_kthread->name = name;
+       enable_irq();
        fn(arg);
+       disable_irq();
        pcpui->cur_kthread->name = 0;
        /* if we blocked, when we return, PRKM will smp_idle() */
 }