aboutsummaryrefslogtreecommitdiffstats
path: root/common/cyclic.c
diff options
context:
space:
mode:
authorRasmus Villemoes <ravi@prevas.dk>2024-10-03 23:27:51 +0200
committerStefan Roese <sr@denx.de>2024-10-23 06:52:38 +0200
commit4457e5c61d825a2673547e4cd60570a77fbcc3cd (patch)
tree926454406873a67239bd9cd4bb7b4113a3ed6253 /common/cyclic.c
parent625094536716631915e6e8b8e4d16d4b25a1645d (diff)
downloadu-boot-4457e5c61d825a2673547e4cd60570a77fbcc3cd.tar.gz
cyclic: introduce u-boot/schedule.h
I noticed an "unnecessary" include of <cyclic.h> in global_data.h, in the sense that nothing in cyclic.h is needed in order to define 'struct global_data'. Well, it's not unnecessary, as it implicitly ensures that everybody gets a declaration of schedule(), and schedule() is (obviously) called all over the tree. Almost none of those places directly include <cyclic.h>, but for historical reasons, many do include <watchdog.h> (most schedule() instances are replacements of WATCHDOG_RESET()). However, very few TUs actually need the declarations of the cyclic_register() and struct cyclic_info, and they also don't really need anything from the watchdog.h header. So introduce a new header which just contains a declaration of schedule(), which can then be included from all the places that do call schedule(). I removed the direct reference to cyclic_run(), because we shouldn't have two public functions for doing roughly the same without being very explicit about when one should call one or the other. Testing of later patches that explicitly include <schedule.h> when schedule() is used revealed a problem with host tool build on win32, which apparently picked up a host <schedule.h>. To avoid that problem, put the new header in include/u-boot/ and hence make the include statements say <u-boot/schedule.h>. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'common/cyclic.c')
-rw-r--r--common/cyclic.c1
1 files changed, 1 insertions, 0 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;