X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fproc.h;h=19bb5efaa23a4ec10338382ff61de286b238cc55;hb=e8b0472be10fba4ca6baa62d8d483db90e28c06e;hp=2def1459ef44362dac8da3699f70705ca5783c99;hpb=593c2a6e032d4696a67ddcc0dfb8401ef537fae4;p=bertos.git diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index 2def1459..19bb5efa 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -95,6 +95,7 @@ #include "cfg/cfg_proc.h" #include "cfg/cfg_signal.h" #include "cfg/cfg_monitor.h" +#include "sem.h" #include // Node, PriNode @@ -104,7 +105,12 @@ #include // cpu_stack_t #include // CPU_SAVED_REGS_CNT -#include +/* The following silents warnings on nightly tests. We need to regenerate + * all the projects before this can be removed. + */ +#ifndef CONFIG_KERN_PRI_INHERIT +#define CONFIG_KERN_PRI_INHERIT 0 +#endif /* * WARNING: struct Process is considered private, so its definition can change any time @@ -117,6 +123,12 @@ typedef struct Process { #if CONFIG_KERN_PRI PriNode link; /**< Link Process into scheduler lists */ +# if CONFIG_KERN_PRI_INHERIT + PriNode inh_link; /**< Link Process into priority inheritance lists */ + List inh_list; /**< Priority inheritance list for this Process */ + Semaphore *inh_blocked_by; /**< Semaphore blocking this Process */ + int orig_pri; /**< Process priority without considering inheritance */ +# endif #else Node link; /**< Link Process into scheduler lists */ #endif @@ -242,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