Merge branch "preempt" in "trunk".
[bertos.git] / bertos / kern / irq.c
index c894631950c2ebfe44dcf6b81a30ac92201c48d1..85608147e1277af38adbdedb1fd8af89e94575c4 100644 (file)
  *
  * \brief Process scheduler (public interface).
  *
- * \version $Id: proc.h 1646 2008-08-17 13:49:48Z bernie $
+ * \version $Id$
  * \author Bernie Innocenti <bernie@codewiz.org>
+ *
+ * Still in development, disable nightly test for now
+ * notest: avr
+ * notest: arm
  */
 #include "irq.h"
 
 #include <kern/proc_p.h>
 #include <kern/proc.h>
 
-#include <cfg/cfg_kern.h>
+#include "cfg/cfg_proc.h"
 
 #include <unistd.h> // FIXME: move POSIX stuff to irq_posix.h
 
-
 MOD_DEFINE(irq)
 
 // FIXME
@@ -53,30 +56,7 @@ static void (*irq_handlers[100])(void);
 /* signal handler */
 void irq_entry(int signum)
 {
-       Process * const old_process = CurrentProcess;
-
        irq_handlers[signum]();
-
-#if CONFIG_KERN_PREEMPT
-       ASSERT2(CurrentProcess, "no idle proc?");
-
-       if (old_process != CurrentProcess)
-       {
-               IRQ_DISABLE;
-
-               TRACEMSG("switching from %p:%s to %p:%s",
-                       old_process, old_process ? old_process->monitor.name : "---",
-                       CurrentProcess, proc_currentName());
-
-               if (old_process)
-                       swapcontext(&old_process->context, &CurrentProcess->context);
-               else
-                       setcontext(&CurrentProcess->context);
-
-               IRQ_ENABLE;
-       }
-       TRACEMSG("resuming %p:%s", CurrentProcess, CurrentProcess->monitor.name);
-#endif // CONFIG_KERN_PREEMPT
 }
 
 void irq_register(int irq, void (*callback)(void))
@@ -87,6 +67,7 @@ void irq_register(int irq, void (*callback)(void))
 void irq_init(void)
 {
        struct sigaction act;
+
        act.sa_handler = irq_entry;
        sigemptyset(&act.sa_mask);
        //sigaddset(&act.sa_mask, irq);