/** * \file * * * \brief Process scheduler (public interface). * * \author Bernie Innocenti * * Still in development, disable nightly test for now * notest: avr * notest: arm */ #include "irq.h" #include #include #include #include "cfg/cfg_proc.h" #include // FIXME: move POSIX stuff to irq_posix.h MOD_DEFINE(irq) // FIXME static void (*irq_handlers[100])(void); /* signal handler */ void irq_entry(int signum) { irq_handlers[signum](); } void irq_register(int irq, void (*callback)(void)) { irq_handlers[irq] = callback; } void irq_init(void) { struct sigaction act; act.sa_handler = irq_entry; sigemptyset(&act.sa_mask); //sigaddset(&act.sa_mask, irq); act.sa_flags = SA_RESTART; // | SA_SIGINFO; sigaction(SIGUSR1, &act, NULL); sigaction(SIGALRM, &act, NULL); MOD_INIT(irq); }