X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fpreempt.c;h=825505019aebeae98ed03f7efe77bc383ecd385a;hb=7c7aee2a95be7ee8b1c9f4b011a1274524bb664e;hp=f285d43f5a53c3e3932f3d1d5edca9be072a26d2;hpb=cf6017f59fb2ff71423c716ad9d9f60a1b65c7d0;p=bertos.git diff --git a/bertos/kern/preempt.c b/bertos/kern/preempt.c index f285d43f..82550501 100644 --- a/bertos/kern/preempt.c +++ b/bertos/kern/preempt.c @@ -35,6 +35,10 @@ * \author Bernie Innocenti */ +#include + +#if CONFIG_KERN_PREEMPT + #include "proc_p.h" #include "proc.h" @@ -44,7 +48,13 @@ #include // IRQ_DISABLE()... #include #include +#include // CONFIG_DEPEND() + +// Check config dependencies +CONFIG_DEPEND(CONFIG_KERN_PREEMPT, CONFIG_KERN_SCHED && CONFIG_TIMER_EVENTS && CONFIG_KERN_IRQ); +CONFIG_DEPEND(CONFIG_KERN_PRI, CONFIG_KERN_PREEMPT); +MOD_DEFINE(preempt) int preempt_forbid_cnt; @@ -140,4 +150,8 @@ void preempt_init(void) timer_add(&preempt_timer); idle_init(); + + MOD_INIT(preempt); } + +#endif // CONFIG_KERN_PREEMPT