Motr
M0
|
Data Structures | |
struct | m0_co_la_item |
struct | m0_co_locals_allocator |
struct | m0_co_context |
struct | m0_co_op |
Macros | |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_LIB |
#define | M0_CO_START(context) |
#define | M0_CO_END(context) |
#define | M0_CO_FUN(context, function) |
#define | M0_CO_FRAME_DATA(field) (__frame_data__->field) |
#define | M0_CO_REENTER(context, ...) |
#define | M0_CO__REENTER(context, frame_data) |
#define | M0_CO_YIELD_RC(context, rc) |
#define | M0_CO_YIELD(context) M0_CO_YIELD_RC(context, -EAGAIN) |
Enumerations | |
enum | m0_co_op_state { COR_INVALID, COR_INIT, COR_ACTIVE, COR_DONE } |
enum | { M0_MCC_STACK_NR = 0x20, M0_MCC_LOCALS_ALLOC_SZ = 4096, M0_MCC_LOCALS_ALLOC_SHIFT = 3, M0_MCC_LOCALS_ALLOC_ALIGN = 1ULL << M0_MCC_LOCALS_ALLOC_SHIFT, M0_MCC_LOCALS_ALLOC_PAD_SZ = 2 * M0_MCC_LOCALS_ALLOC_ALIGN } |
Functions | |
static int | locals_alloc_init (struct m0_co_locals_allocator *alloc) |
static void | locals_alloc_fini (struct m0_co_locals_allocator *alloc) |
static void * | locals_alloc (struct m0_co_locals_allocator *alloc, uint64_t frame, uint64_t size) |
static void | locals_free (struct m0_co_locals_allocator *alloc, uint64_t frame) |
M0_INTERNAL void | m0_co_context_locals_alloc (struct m0_co_context *context, uint64_t size) |
M0_INTERNAL void | m0_co_context_locals_free (struct m0_co_context *context) |
M0_INTERNAL void * | m0_co_context_locals (struct m0_co_context *context) |
M0_INTERNAL int | m0_co_context_init (struct m0_co_context *context) |
M0_INTERNAL void | m0_co_context_fini (struct m0_co_context *context) |
M0_INTERNAL void | m0_co_op_init (struct m0_co_op *op) |
M0_INTERNAL void | m0_co_op_fini (struct m0_co_op *op) |
M0_INTERNAL void | m0_co_op_reset (struct m0_co_op *op) |
M0_INTERNAL void | m0_co_op_active (struct m0_co_op *op) |
M0_INTERNAL void | m0_co_op_done (struct m0_co_op *op) |
M0_INTERNAL int | m0_co_op_tick_ret (struct m0_co_op *op, struct m0_fom *fom, int next_state) |
Variables | |
enum m0_co_op_state | M0_XCA_DOMAIN |
static struct m0_sm_state_descr | co_states [] |
static struct m0_sm_trans_descr | co_trans [] |
M0_INTERNAL struct m0_sm_conf | co_states_conf |
#define M0_CO__REENTER | ( | context, | |
frame_data | |||
) |
Mostly for internal usage.
Definition at line 223 of file coroutine.h.
#define M0_CO_END | ( | context | ) |
context | – |
Definition at line 167 of file coroutine.h.
Definition at line 199 of file coroutine.h.
#define M0_CO_FUN | ( | context, | |
function | |||
) |
_context | – |
function | – function call with or without assignments F(rc) = fooX(context, ...) |
Definition at line 183 of file coroutine.h.
#define M0_CO_REENTER | ( | context, | |
... | |||
) |
_context | – |
__VA_ARGS__ | – ‘Restorable variables’, local context of this function |
Definition at line 205 of file coroutine.h.
#define M0_CO_START | ( | context | ) |
M0_CO_START()/M0_CO_END() wrap coroutine call and provide means to control the control flow of it.
Definition at line 157 of file coroutine.h.
#define M0_CO_YIELD | ( | context | ) | M0_CO_YIELD_RC(context, -EAGAIN) |
Definition at line 266 of file coroutine.h.
#define M0_CO_YIELD_RC | ( | context, | |
rc | |||
) |
M0_CO_YIELD() is used like return statement in cases, function needs to wait for some external event, like IO. Typically, user has to arm something, which will generete such an event and call M0_CO_YIELD(). On behalf of FOM, event has to wake up this FOM when it's ready or in any other suitable case. After this point M0_CO_* machinery will return control flow back into the point right after M0_CO_YIELD().
_context | – |
Definition at line 248 of file coroutine.h.
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_LIB |
Definition at line 29 of file coroutine.c.
anonymous enum |
Enumerator | |
---|---|
M0_MCC_STACK_NR | |
M0_MCC_LOCALS_ALLOC_SZ | |
M0_MCC_LOCALS_ALLOC_SHIFT | |
M0_MCC_LOCALS_ALLOC_ALIGN | |
M0_MCC_LOCALS_ALLOC_PAD_SZ |
Definition at line 37 of file coroutine.h.
enum m0_co_op_state |
Enumerator | |
---|---|
COR_INVALID | |
COR_INIT | |
COR_ACTIVE | |
COR_DONE |
Definition at line 141 of file coroutine.c.
|
static |
Definition at line 51 of file coroutine.c.
|
static |
Definition at line 44 of file coroutine.c.
|
static |
Definition at line 36 of file coroutine.c.
|
static |
Definition at line 89 of file coroutine.c.
M0_INTERNAL void m0_co_context_fini | ( | struct m0_co_context * | context | ) |
Definition at line 136 of file coroutine.c.
M0_INTERNAL int m0_co_context_init | ( | struct m0_co_context * | context | ) |
Definition at line 130 of file coroutine.c.
M0_INTERNAL void * m0_co_context_locals | ( | struct m0_co_context * | context | ) |
Definition at line 124 of file coroutine.c.
M0_INTERNAL void m0_co_context_locals_alloc | ( | struct m0_co_context * | context, |
uint64_t | size | ||
) |
M0_INTERNAL void m0_co_context_locals_free | ( | struct m0_co_context * | context | ) |
M0_INTERNAL void m0_co_op_active | ( | struct m0_co_op * | op | ) |
Definition at line 210 of file coroutine.c.
M0_INTERNAL void m0_co_op_done | ( | struct m0_co_op * | op | ) |
Definition at line 218 of file coroutine.c.
M0_INTERNAL void m0_co_op_fini | ( | struct m0_co_op * | op | ) |
Definition at line 188 of file coroutine.c.
M0_INTERNAL void m0_co_op_init | ( | struct m0_co_op * | op | ) |
Definition at line 179 of file coroutine.c.
M0_INTERNAL void m0_co_op_reset | ( | struct m0_co_op * | op | ) |
Definition at line 203 of file coroutine.c.
Definition at line 226 of file coroutine.c.
|
static |
Definition at line 148 of file coroutine.c.
M0_INTERNAL struct m0_sm_conf co_states_conf |
Definition at line 171 of file coroutine.c.
|
static |
Definition at line 166 of file coroutine.c.
enum m0_co_op_state M0_XCA_DOMAIN |