X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Firq.c;h=42012db9cde0ea0268f2c76e49b74331bc5984d7;hb=71743c2a5a8bf9dbf66a945fd9656baed0d16329;hp=9b87d69b25420b03798c027adad670524a1ff65f;hpb=cfa8814ca45e8bae9b36713bc534ecb581834016;p=bertos.git diff --git a/bertos/kern/irq.c b/bertos/kern/irq.c index 9b87d69b..42012db9 100644 --- a/bertos/kern/irq.c +++ b/bertos/kern/irq.c @@ -33,13 +33,18 @@ * * \version $Id: proc.h 1646 2008-08-17 13:49:48Z bernie $ * \author Bernie Innocenti + * + * Still in development, disable nightly test for now + * notest: avr + * notest: arm */ #include "irq.h" #include #include +#include -#include +#include "cfg/cfg_proc.h" #include // FIXME: move POSIX stuff to irq_posix.h @@ -52,7 +57,9 @@ static void (*irq_handlers[100])(void); /* signal handler */ void irq_entry(int signum) { +#if CONFIG_KERN_PREEMPT Process * const old_process = CurrentProcess; +#endif irq_handlers[signum](); @@ -61,18 +68,20 @@ void irq_entry(int signum) if (old_process != CurrentProcess) { + IRQ_DISABLE; + TRACEMSG("switching from %p:%s to %p:%s", old_process, old_process ? old_process->monitor.name : "---", - CurrentProcess, CurrentProcess->monitor.name); + CurrentProcess, proc_currentName()); if (old_process) swapcontext(&old_process->context, &CurrentProcess->context); else setcontext(&CurrentProcess->context); - // not reached + IRQ_ENABLE; } - //TRACEMSG("keeping %p:%s", CurrentProcess, CurrentProcess->monitor.name); + TRACEMSG("resuming %p:%s", CurrentProcess, CurrentProcess->monitor.name); #endif // CONFIG_KERN_PREEMPT } @@ -84,6 +93,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);