Use a better name.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 26 Oct 2009 22:41:56 +0000 (22:41 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 26 Oct 2009 22:41:56 +0000 (22:41 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3103 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/preempt.c
bertos/kern/proc.h
bertos/kern/signal.c

index 398e8efe00221aae63ea7375c2a5ec58f0a82362..48a1278ebffa7b0d6df4937a417d2c08eb82b3bf 100644 (file)
@@ -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);
index fa118c188ac979d690fc2b9eb8026915d5534ca2..db269398ab8462aa54c8ee515ad6e1b22d81ab64 100644 (file)
@@ -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.
  */
index f9b013bfb664d18e1999572f471de584d6685db2..dbe1261f2053381e7a4127e67ee084504f00bca3 100644 (file)
@@ -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