From: batt Date: Mon, 26 Oct 2009 22:41:56 +0000 (+0000) Subject: Use a better name. X-Git-Tag: 2.4.0~94 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=cf5af2b25de263a964bf29a7465cdfe536d32e59;p=bertos.git Use a better name. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3103 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/preempt.c b/bertos/kern/preempt.c index 398e8efe..48a1278e 100644 --- a/bertos/kern/preempt.c +++ b/bertos/kern/preempt.c @@ -75,7 +75,7 @@ void proc_schedule(void) { IRQ_DISABLE; - ASSERT(proc_allowed()); + ASSERT(proc_preemptAllowed()); LIST_ASSERT_VALID(&ProcReadyList); CurrentProcess = (struct Process *)list_remHead(&ProcReadyList); ASSERT2(CurrentProcess, "no idle proc?"); @@ -87,7 +87,7 @@ void proc_schedule(void) void proc_preempt(UNUSED_ARG(void *, param)) { - if (proc_allowed()) + if (proc_preemptAllowed()) { IRQ_DISABLE; @@ -123,7 +123,7 @@ void proc_switch(void) /* Sleeping with IRQs disabled or preemption forbidden is illegal */ IRQ_ASSERT_ENABLED(); - ASSERT(proc_allowed()); + ASSERT(proc_preemptAllowed()); // Will invoke proc_switch() in interrupt context kill(0, SIGUSR1); diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index fa118c18..db269398 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -281,7 +281,7 @@ INLINE void proc_permit(void) * \note This accessor is needed because _preempt_forbid_cnt * must be absoultely private. */ -INLINE bool proc_allowed(void) +INLINE bool proc_preemptAllowed(void) { #if CONFIG_KERN_PREEMPT extern cpu_atomic_t _preempt_forbid_cnt; @@ -291,6 +291,9 @@ INLINE bool proc_allowed(void) #endif } +/** Deprecated, use the proc_preemptAllowed() macro. */ +#define proc_allowed() proc_preemptAllowed() + /** * Execute a block of \a CODE atomically with respect to task scheduling. */ diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index f9b013bf..dbe1261f 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -144,7 +144,7 @@ sigmask_t sig_wait(sigmask_t sigs) /* Sleeping with IRQs disabled or preemption forbidden is illegal */ IRQ_ASSERT_ENABLED(); - ASSERT(proc_allowed()); + ASSERT(proc_preemptAllowed()); /* * This is subtle: there's a race condition where a concurrent