X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fproc.h;h=f8de758ffeec511879400f20d750311d3b3c992b;hb=84c1846c483f7ddad5804c555c7e0d207f8d1ddc;hp=6a4aff8be5dc8ff9eb9284de283ff75eb15cd159;hpb=2fd9ef1b509baed0c97876e1f517125db9f78f96;p=bertos.git diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index 6a4aff8b..f8de758f 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -46,6 +46,7 @@ #endif #include // cpustack_t +#include // CPU_SAVED_REGS_CNT /* * Forward declaration. The definition of struct Process is private to the @@ -65,7 +66,6 @@ struct Process *proc_new_with_name(const char* name, void (*entry)(void), iptr_t void proc_exit(void); void proc_yield(void); -#define proc_switch proc_yield /* OBSOLETE */ int proc_testSetup(void); int proc_testRun(void); @@ -85,6 +85,9 @@ const char *proc_currentName(void); } #endif +/** Global preemption disable nesting counter. */ +extern int preempt_forbid_cnt; + /** * Disable preemptive task switching. * @@ -106,7 +109,6 @@ INLINE void proc_forbid(void) { #if CONFIG_KERN_PREEMPT // No need to protect against interrupts here. - extern int preempt_forbid_cnt; ++preempt_forbid_cnt; /* @@ -133,7 +135,6 @@ INLINE void proc_permit(void) MEMORY_BARRIER; /* No need to protect against interrupts here. */ - extern int preempt_forbid_cnt; --preempt_forbid_cnt; ASSERT(preempt_forbid_cnt >= 0); @@ -146,7 +147,6 @@ INLINE void proc_permit(void) #endif } - /** * Execute a block of \a CODE atomically with respect to task scheduling. */ @@ -188,8 +188,6 @@ INLINE void proc_permit(void) #endif #endif -#define CONFIG_PROC_DEFSTACKSIZE CONFIG_KERN_MINSTACKSIZE // OBSOLETE - /* Memory fill codes to help debugging */ #if CONFIG_KERN_MONITOR #include