![]() |
EVE 1.0
|
![]() |
Data Structures | |
struct | work_t |
struct | swint_state_t |
Macros | |
#define | WORK_INIT(work, callback) |
#define | WORK_INIT_TYPED(work, callback) (struct work_t) WORK_INIT(work, callback) |
#define | DECLARE_WORK(work, callback) struct work_t work = WORK_INIT(work, callback) |
#define | SWINT_AUTO_LOCK() |
Typedefs | |
typedef void(* | work_cb_t) (struct work_t *work) |
Functions | |
void | work_schedule (struct work_t *work) |
void | work_cancel (struct work_t *work) |
static bool | work_pending (struct work_t *work) |
swint_state_t | swint_disable (void) |
void | swint_enable (swint_state_t state) |
__attribute__ ((always_inline)) static inline void swint_enable_indirect_adapter(swint_state_t *state) | |
#define WORK_INIT | ( | work, | |
callback | |||
) |
Initializes a work structure.
The macro is used to initialize a work structure instance.
work | work structure |
callback | work callback |
Usage:
#define SWINT_AUTO_LOCK | ( | ) |
Declares an anonymous software interrupt lock, which disables software interrupts in scope of the the auto variable visibility block
Usage:
Note: taking in mind lazy nature of releasing the clock locks, use of auto clock locks is negligible.
typedef void(* work_cb_t) (struct work_t *work) |
void work_schedule | ( | struct work_t * | work | ) |
Schedules a work.
The function schedules a work item for execution at the software interrupt level. Depending on the current interrupt level and the software interrupt enable status, the work item callback may be called immediately or be queued until the software interrupt level is available.
Framework keeps order of execution of the scheduled work items. First scheduled work is executed first.
Is the work structure, pointed by the work
parameter is already scheduled for execution, then it is re-scheduled at the tail of the work queue.
work | pointer to the work structure |
void work_cancel | ( | struct work_t * | work | ) |
Removes a work from the work queue.
The function removes a previously scheduled work from the work queue.
work | pointer to the work structure |
|
inlinestatic |
Checks if the work is scheduled and pending execution.
The function checks if the work is scheduled for execution.
work | pointer to the work structure |
Definition at line 195 of file work.h.
References dlist_is_empty(), work_t::link, swint_disable(), and swint_enable().
swint_state_t swint_disable | ( | void | ) |
Disables software interrupt processing
The function disables software interrupt processing
Usage:
Referenced by app_timer_start(), and work_pending().
void swint_enable | ( | swint_state_t | state | ) |
Restores software interrupt processing
The function conditionally enables software interrupt processing
Usage:
state | state, obtained by corresponding swint_disable() call |
Referenced by __attribute__(), app_timer_start(), and work_pending().
__attribute__ | ( | (always_inline) | ) |
Cleanup adapter for SWINT_AUTO_LOCK()
Definition at line 245 of file work.h.
References swint_enable().
Referenced by uip_log().