X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fproc.h;h=9b4fe140efc8cb9312aec235012545330a1ae156;hb=2dee7965cd538d8d440524465ef4ad18111b2eda;hp=bacd052be848fdebf85b826ece98fb527a88ca63;hpb=f149112c04843df99b2c9e9fd2ef47d9cacae8a4;p=bertos.git diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index bacd052b..9b4fe140 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -37,7 +37,7 @@ * * $WIZ$ module_name = "kernel" * $WIZ$ module_configuration = "bertos/cfg/cfg_proc.h" - * $WIZ$ module_depends = "switch_ctx", "coop", "preempt" + * $WIZ$ module_depends = "switch_ctx" * $WIZ$ module_supports = "not atmega103" */ @@ -51,11 +51,7 @@ #include // Node, PriNode #include - -#if CONFIG_KERN_PREEMPT - #include // ASSERT() - #include -#endif +#include // ASSERT() #include // cpu_stack_t #include // CPU_SAVED_REGS_CNT @@ -146,41 +142,19 @@ void proc_exit(void); * Public scheduling class methods. */ void proc_yield(void); -void proc_preempt(void); -int proc_needPreempt(void); -void proc_wakeup(Process *proc); -/** - * Dummy function that defines unimplemented scheduler class methods. - */ -INLINE void __proc_noop(void) +#if CONFIG_KERN_PREEMPT +bool proc_needPreempt(void); +void proc_preempt(void); +#else +INLINE bool proc_needPreempt(void) { + return false; } -#if CONFIG_KERN_PREEMPT - /** - * Preemptive scheduler public methods. - */ - #define preempt_yield proc_yield - #define preempt_needPreempt proc_needPreempt - #define preempt_preempt proc_preempt - /** - * Preemptive scheduler: private methods. - */ - #define preempt_switch proc_switch - #define preempt_wakeup proc_wakeup -#else - /** - * Co-operative scheduler: public methods. - */ - #define coop_yield proc_yield - #define proc_needPreempt __proc_noop - #define proc_preempt __proc_noop - /** - * Co-operative scheduler: private methods. - */ - #define coop_switch proc_switch - #define coop_wakeup proc_wakeup +INLINE void proc_preempt(void) +{ +} #endif void proc_rename(struct Process *proc, const char *name);