aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2022-10-28 13:50:50 +0200
committerStefan Roese <sr@denx.de>2022-11-02 08:41:20 +0100
commitd7de5ef629352fe12ad99b6539ba1480b923f31e (patch)
treef07506e628568757fe3edc858a648e6915d00a51 /common
parentc8d9ff634fc429db5acf2f5386ea937f0fef1ae7 (diff)
downloadu-boot-d7de5ef629352fe12ad99b6539ba1480b923f31e.zip
u-boot-d7de5ef629352fe12ad99b6539ba1480b923f31e.tar.gz
u-boot-d7de5ef629352fe12ad99b6539ba1480b923f31e.tar.bz2
cyclic: use a flag in gd->flags for recursion protection
As a preparation for future patches, use a flag in gd->flags rather than a separate member in (the singleton) struct cyclic_drv to keep track of whether we're already inside cyclic_run(). Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de> Tested-by: Tim Harvey <tharvey@gateworks.com> # imx8mm-venice-*
Diffstat (limited to 'common')
-rw-r--r--common/cyclic.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/cyclic.c b/common/cyclic.c
index 7abb82c..ff75c8c 100644
--- a/common/cyclic.c
+++ b/common/cyclic.c
@@ -66,10 +66,10 @@ void cyclic_run(void)
uint64_t now, cpu_time;
/* Prevent recursion */
- if (gd->cyclic->cyclic_running)
+ if (gd->flags & GD_FLG_CYCLIC_RUNNING)
return;
- gd->cyclic->cyclic_running = true;
+ gd->flags |= GD_FLG_CYCLIC_RUNNING;
list_for_each_entry_safe(cyclic, tmp, &gd->cyclic->cyclic_list, list) {
/*
* Check if this cyclic function needs to get called, e.g.
@@ -99,7 +99,7 @@ void cyclic_run(void)
}
}
}
- gd->cyclic->cyclic_running = false;
+ gd->flags &= ~GD_FLG_CYCLIC_RUNNING;
}
void schedule(void)