summaryrefslogtreecommitdiff
path: root/include/slice.h
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-22 10:26:12 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-25 09:30:33 +0200
commit6ed59a76a0d1250059b8cdd61e0c3cf0f25b5a69 (patch)
tree248965d7519753bb0e23105a277166416e569398 /include/slice.h
parentf866f471337e3249e0946764f09841baf73d6c9d (diff)
downloadbarebox-6ed59a76a0d1250059b8cdd61e0c3cf0f25b5a69.tar.gz
common: move workqueue handling from poller_call() to sched()
Workqueues are run out of poller_call, not because of a dependency, but because when they were added, poller_call was directly called from is_timeout. With the addition of bthreads, there is now a general resched() function that runs pollers and switches between bthreads. It makes sense to move workqueue handling there as well to keep scheduling matter contained in a single function. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/slice.h')
-rw-r--r--include/slice.h6
1 files changed, 2 insertions, 4 deletions
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)