diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/poller.h | 8 | ||||
-rw-r--r-- | include/sched.h | 10 | ||||
-rw-r--r-- | include/slice.h | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/include/poller.h b/include/poller.h index 371dafc6f8..6e51a06133 100644 --- a/include/poller.h +++ b/include/poller.h @@ -7,6 +7,7 @@ #define POLLER_H #include <linux/list.h> +#include <linux/types.h> struct poller_struct { void (*func)(struct poller_struct *poller); @@ -39,11 +40,14 @@ static inline bool poller_async_active(struct poller_async *pa) return pa->active; } -extern int poller_active; - #ifdef CONFIG_POLLER +bool poller_active(void); void poller_call(void); #else +static inline bool poller_active(void) +{ + return false; +} static inline void poller_call(void) { } diff --git a/include/sched.h b/include/sched.h index 57be1678fd..4dadff2069 100644 --- a/include/sched.h +++ b/include/sched.h @@ -2,14 +2,12 @@ #ifndef __BAREBOX_SCHED_H_ #define __BAREBOX_SCHED_H_ -#include <bthread.h> -#include <poller.h> - +#ifdef CONFIG_HAS_SCHED +void resched(void); +#else static inline void resched(void) { - poller_call(); - if (!IS_ENABLED(CONFIG_POLLER) || !poller_active) - bthread_reschedule(); } +#endif #endif diff --git a/include/slice.h b/include/slice.h index cf684300a8..67d47b9082 100644 --- a/include/slice.h +++ b/include/slice.h @@ -2,6 +2,7 @@ #define __SLICE_H #include <bthread.h> +#include <poller.h> enum slice_action { SLICE_ACQUIRE = 1, @@ -35,11 +36,8 @@ extern struct slice command_slice; void command_slice_acquire(void); void command_slice_release(void); -extern int poller_active; - #define assert_command_context() do { \ - WARN_ONCE(IS_ENABLED(CONFIG_POLLER) && poller_active, \ - "%s called in poller\n", __func__); \ + WARN_ONCE(poller_active(), "%s called in poller\n", __func__); \ WARN_ONCE(IS_ENABLED(CONFIG_BTHREAD) && !bthread_is_main(current), \ "%s called in secondary bthread\n", __func__); \ } while (0) |