X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fsignal.c;h=58863ffa5670bdda9f25ff06e201c4e73f85a598;hb=e62ca0b357f09804d7d894949df44224c9d74bb7;hp=d4fe178ed75567c21348dc72b1665eb477a608a3;hpb=0e8fc7e3fe0e2cb2e75d0b3b9da1899f74074d0c;p=bertos.git diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index d4fe178e..58863ffa 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -117,7 +117,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,12 +135,11 @@ sigmask_t sig_check(sigmask_t sigs) sigmask_t sig_wait(sigmask_t sigs) { sigmask_t result; - cpuflags_t flags; - extern int preempt_forbid_cnt; + cpu_flags_t flags; /* Sleeping with IRQs disabled or preemption forbidden is illegal */ IRQ_ASSERT_ENABLED(); - ASSERT(preempt_forbid_cnt == 0); + ASSERT(proc_allowed()); /* * This is subtle: there's a race condition where a concurrent @@ -203,7 +202,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)); @@ -234,7 +233,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);