Add proc_pri function to extract a Process priority.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 11 Jan 2012 14:40:14 +0000 (14:40 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 11 Jan 2012 14:40:14 +0000 (14:40 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5238 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/proc.h

index 1cacc2bc4a12f42605144234eeeef60f7f6f361a..19bb5efaa23a4ec10338382ff61de286b238cc55 100644 (file)
@@ -254,10 +254,20 @@ INLINE struct Process *proc_current(void)
 
 #if CONFIG_KERN_PRI
        void proc_setPri(struct Process *proc, int pri);
+
+       INLINE int proc_pri(struct Process *proc)
+       {
+               return proc->link.pri;
+       }
 #else
        INLINE void proc_setPri(UNUSED_ARG(struct Process *,proc), UNUSED_ARG(int, pri))
        {
        }
+
+       INLINE int proc_pri(UNUSED_ARG(struct Process *, proc))
+       {
+               return 0;
+       }
 #endif
 
 #if CONFIG_KERN_PREEMPT