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;
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
CurrentProcess->sig_wait = sigs;
/*
- * Go to sleep and proc_schedule() another process.
+ * Go to sleep and proc_switch() to another process.
*
- * We re-enable IRQs because proc_schedule() does not
+ * We re-enable IRQs because proc_switch() does not
* guarantee to save and restore the interrupt mask.
*/
IRQ_RESTORE(flags);
- proc_schedule();
+ proc_switch();
IRQ_SAVE_DISABLE(flags);
/*
{
Timer t;
sigmask_t res;
- cpuflags_t flags;
+ cpu_flags_t flags;
ASSERT(!sig_check(SIG_TIMEOUT));
ASSERT(!(sigs & SIG_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);