X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fsignal.c;h=dbe1261f2053381e7a4127e67ee084504f00bca3;hb=cf5af2b25de263a964bf29a7465cdfe536d32e59;hp=948d68f1d814c687e8edb805b047da4596975242;hpb=024774c0df35faaade316607b5772090c847aac4;p=bertos.git diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index 948d68f1..dbe1261f 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -100,8 +100,10 @@ #include "signal.h" -#include +#include "cfg/cfg_timer.h" #include +#include + #include #include #include @@ -109,6 +111,9 @@ #if CONFIG_KERN_SIGNALS +// Check config dependencies +CONFIG_DEPEND(CONFIG_KERN_SIGNALS, CONFIG_KERN); + /** * Check if any of the signals in \a sigs has occurred and clear them. * @@ -117,7 +122,7 @@ sigmask_t sig_check(sigmask_t sigs) { sigmask_t result; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); result = CurrentProcess->sig_recv & sigs; @@ -135,14 +140,11 @@ sigmask_t sig_check(sigmask_t sigs) sigmask_t sig_wait(sigmask_t sigs) { sigmask_t result; - cpuflags_t flags; + cpu_flags_t flags; /* Sleeping with IRQs disabled or preemption forbidden is illegal */ IRQ_ASSERT_ENABLED(); - - #if CONFIG_KERN_PREEMPT - ASSERT(preempt_forbid_cnt == 0); - #endif + ASSERT(proc_preemptAllowed()); /* * This is subtle: there's a race condition where a concurrent @@ -205,7 +207,7 @@ sigmask_t sig_waitTimeout(sigmask_t sigs, ticks_t timeout) { Timer t; sigmask_t res; - cpuflags_t flags; + cpu_flags_t flags; ASSERT(!sig_check(SIG_TIMEOUT)); ASSERT(!(sigs & SIG_TIMEOUT)); @@ -236,7 +238,7 @@ sigmask_t sig_waitTimeout(sigmask_t sigs, ticks_t timeout) */ void sig_signal(Process *proc, sigmask_t sigs) { - cpuflags_t flags; + cpu_flags_t flags; /* See comment in sig_wait() for why this protection is necessary */ IRQ_SAVE_DISABLE(flags);