kernel/poll: Make the poll callback a single-byte enum instead

Somewhat weirdly, k_poll() can do one of two things when the set of
events is signaled: it can wake up a sleeping thread, or it can submit
an unrelated work item to a work queue.  The difference in behaviors
is currently captured by a callback, but as there are only two it's
cleaner to put this into a "mode" enumerant.  That also shrinks the
size of the data such that the poller struct can be moved somewhere
other than the calling stack.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2020-10-30 11:18:53 -07:00 committed by Anas Nashif
commit 0c7af40d61
2 changed files with 22 additions and 14 deletions

View file

@ -2717,7 +2717,7 @@ typedef int (*_poller_cb_t)(struct k_poll_event *event, uint32_t state);
struct _poller {
volatile bool is_polling;
struct k_thread *thread;
_poller_cb_t cb;
uint8_t mode;
};
/**