diff options
-rw-r--r-- | common/cyclic.c | 1 | ||||
-rw-r--r-- | include/cyclic.h | 12 | ||||
-rw-r--r-- | include/u-boot/schedule.h | 24 |
3 files changed, 26 insertions, 11 deletions
diff --git a/common/cyclic.c b/common/cyclic.c index ec38fad6775..38d815bec35 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -15,6 +15,7 @@ #include <linux/errno.h> #include <linux/list.h> #include <asm/global_data.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/include/cyclic.h b/include/cyclic.h index cd95b691d48..e8de616dcd5 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -13,6 +13,7 @@ #include <linux/list.h> #include <asm/types.h> +#include <u-boot/schedule.h> // to be removed later /** * struct cyclic_info - Information about cyclic execution function @@ -94,13 +95,6 @@ struct hlist_head *cyclic_get_list(void); */ void cyclic_run(void); -/** - * schedule() - Schedule all potentially waiting tasks - * - * Basically a wrapper for cyclic_run(), pontentially enhanced by some - * other parts, that need to get handled periodically. - */ -void schedule(void); #else static inline void cyclic_register(struct cyclic_info *cyclic, cyclic_func_t func, @@ -116,10 +110,6 @@ static inline void cyclic_run(void) { } -static inline void schedule(void) -{ -} - static inline int cyclic_unregister_all(void) { return 0; diff --git a/include/u-boot/schedule.h b/include/u-boot/schedule.h new file mode 100644 index 00000000000..4fd34c41229 --- /dev/null +++ b/include/u-boot/schedule.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _U_BOOT_SCHEDULE_H +#define _U_BOOT_SCHEDULE_H + +#if CONFIG_IS_ENABLED(CYCLIC) +/** + * schedule() - Schedule all potentially waiting tasks + * + * Run all pending tasks registered via the cyclic framework, and + * potentially perform other actions that need to be done + * periodically. + */ +void schedule(void); + +#else + +static inline void schedule(void) +{ +} + +#endif + +#endif |