Merge branch "preempt" in "trunk".
[bertos.git] / bertos / cpu / power.h
index b4550ad6d0b4ba64f8d5b05dfca8113d65799670..d73eb621a785ef17629ff03e25748820983d476f 100644 (file)
@@ -37,8 +37,8 @@
 #ifndef CPU_POWER_H
 #define CPU_POWER_H
 
-#include <cfg/cfg_kern.h>
-#include <cfg/cfg_wdt.h>
+#include "cfg/cfg_proc.h"
+#include "cfg/cfg_wdt.h"
 
 #if CONFIG_KERN
        #include <kern/proc.h>
@@ -67,7 +67,8 @@
 INLINE void cpu_relax(void)
 {
 #if CONFIG_KERN
-       proc_yield();
+       if (proc_preemptAllowed())
+               proc_yield();
 #endif
 
 #if CONFIG_WATCHDOG