Go to the documentation of this file.
30 #define EVAL_CPS_STATE_NONE 0
31 #define EVAL_CPS_STATE_PAUSED 1
32 #define EVAL_CPS_STATE_RUNNING 2
33 #define EVAL_CPS_STATE_KILL 4
34 #define EVAL_CPS_STATE_DEAD 8
35 #define EVAL_CPS_STATE_RESET 16
37 #define EVAL_CPS_DEFAULT_MAILBOX_SIZE 10
40 #define EVAL_CPS_CONTEXT_FLAG_NOTHING (uint32_t)0x00
41 #define EVAL_CPS_CONTEXT_FLAG_TRAP (uint32_t)0x01
42 #define EVAL_CPS_CONTEXT_FLAG_CONST (uint32_t)0x02
43 #define EVAL_CPS_CONTEXT_FLAG_CONST_SYMBOL_STRINGS (uint32_t)0x04
44 #define EVAL_CPS_CONTEXT_FLAG_INCREMENTAL_READ (uint32_t)0x08
45 #define EVAL_CPS_CONTEXT_FLAG_TRAP_UNROLL_RETURN (uint32_t)0x10
46 #define EVAL_CPS_CONTEXT_READER_FLAGS_MASK (EVAL_CPS_CONTEXT_FLAG_CONST | EVAL_CPS_CONTEXT_FLAG_CONST_SYMBOL_STRINGS | EVAL_CPS_CONTEXT_FLAG_INCREMENTAL_READ)
51 #define LBM_THREAD_STATE_READY (uint32_t)0
52 #define LBM_THREAD_STATE_BLOCKED (uint32_t)1
53 #define LBM_THREAD_STATE_TIMEOUT (uint32_t)2
54 #define LBM_THREAD_STATE_SLEEPING (uint32_t)4
55 #define LBM_THREAD_STATE_RECV_BL (uint32_t)8
56 #define LBM_THREAD_STATE_RECV_TO (uint32_t)16
57 #define LBM_THREAD_STATE_GC_BIT (uint32_t)(1 << 31)
59 #define LBM_IS_STATE_TIMEOUT(X) (X & (LBM_THREAD_STATE_TIMEOUT | LBM_THREAD_STATE_RECV_TO))
60 #define LBM_IS_STATE_WAKE_UP_WAKABLE(X) (X & (LBM_THREAD_STATE_SLEEPING | LBM_IS_STATE_TIMEOUT(X)))
61 #define LBM_IS_STATE_UNBLOCKABLE(X) (X & (LBM_THREAD_STATE_BLOCKED | LBM_THREAD_STATE_TIMEOUT))
62 #define LBM_IS_STATE_RECV(X) (X & (LBM_THREAD_STATE_RECV_BL | LBM_THREAD_STATE_RECV_TO))
void lbm_set_verbose(bool verbose)
Definition: eval_cps.c:423
lbm_stack_t K
Definition: eval_cps.h:74
lbm_cid lbm_eval_program_ext(lbm_value lisp, unsigned int stack_size)
Definition: eval_cps.c:5234
bool lbm_unblock_ctx_r(lbm_cid cid)
Definition: eval_cps.c:1342
int lbm_eval_init(void)
Definition: eval_cps.c:5238
int lbm_perform_gc(void)
Definition: eval_cps.c:1584
void lbm_critical_error(void)
Definition: eval_cps.c:1059
lbm_uint buf_len
Definition: eval_cps.h:100
uint32_t state
Definition: eval_cps.h:77
lbm_value curr_exp
Definition: eval_cps.h:65
void lbm_set_user_callback(void(*fptr)(void *))
Definition: eval_cps.c:270
lbm_int row1
Definition: eval_cps.h:83
uint32_t lbm_uint
Definition: lbm_types.h:48
lbm_uint sleep_us
Definition: eval_cps.h:76
void lbm_run_eval(void)
Definition: eval_cps.c:5147
lbm_cid lbm_eval_program(lbm_value lisp)
Definition: eval_cps.c:5230
@ LBM_EVENT_FOR_HANDLER
Definition: eval_cps.h:90
char * error_reason
Definition: eval_cps.h:72
void lbm_request_gc(void)
Definition: eval_cps.c:197
bool lbm_event_unboxed(lbm_value unboxed)
Definition: eval_cps.c:355
uint32_t mailbox_size
Definition: eval_cps.h:68
uint32_t lbm_get_eval_state(void)
Definition: eval_cps.c:5061
void lbm_set_timestamp_us_callback(uint32_t(*fptr)(void))
Definition: eval_cps.c:285
lbm_uint buf_ptr
Definition: eval_cps.h:99
bool lbm_event(lbm_flat_value_t *fv)
Definition: eval_cps.c:368
lbm_cid lbm_get_current_cid(void)
Definition: eval_cps.c:427
bool lbm_event_define(lbm_value key, lbm_flat_value_t *fv)
Definition: eval_cps.c:347
lbm_uint timestamp
Definition: eval_cps.h:75
const fundamental_fun fundamental_table[]
Definition: fundamental.c:1383
lbm_cid lbm_get_event_handler_pid(void)
Definition: eval_cps.c:314
@ LBM_EVENT_UNBLOCK_CTX
Definition: eval_cps.h:91
void lbm_set_error_suspect(lbm_value suspect)
Definition: eval_cps.c:987
char * name
Definition: eval_cps.h:78
lbm_uint parameter
Definition: eval_cps.h:98
lbm_event_type_t
Definition: eval_cps.h:89
void lbm_kill_eval(void)
Definition: eval_cps.c:5056
uint32_t flags
Definition: eval_cps.h:70
void lbm_set_error_reason(char *error_str)
Definition: eval_cps.c:992
void lbm_pause_eval(void)
Definition: eval_cps.c:5039
bool create_string_channel(char *str, lbm_value *res)
Definition: eval_cps.c:826
lbm_flash_status request_flash_storage_cell(lbm_value val, lbm_value *res)
Definition: eval_cps.c:4436
Definition: lbm_channel.h:68
lbm_value lbm_find_receiver_and_send(lbm_cid cid, lbm_value msg)
Definition: eval_cps.c:1412
void lbm_reset_eval(void)
Definition: eval_cps.c:5033
lbm_value * mailbox
Definition: eval_cps.h:67
void lbm_undo_block_ctx_from_extension(void)
Definition: eval_cps.c:1405
eval_context_t * lbm_get_current_context(void)
Definition: eval_cps.c:434
int lbm_remove_done_ctx(lbm_cid cid, lbm_value *v)
struct eval_context_s * prev
Definition: eval_cps.h:85
Definition: lbm_flat_value.h:25
bool lift_char_channel(lbm_char_channel_t *ch, lbm_value *res)
Definition: eval_cps.c:853
void lbm_set_printf_callback(int(*prnt)(const char *,...))
Definition: eval_cps.c:295
@ LBM_EVENT_RUN_USER_CALLBACK
Definition: eval_cps.h:93
void lbm_block_ctx_from_extension(void)
Definition: eval_cps.c:1398
lbm_flash_status
Definition: heap.h:194
bool lbm_event_queue_is_empty(void)
Definition: eval_cps.c:388
void lbm_block_ctx_from_extension_timeout(float s)
Definition: eval_cps.c:1394
bool app_cont
Definition: eval_cps.h:73
lbm_cid id
Definition: eval_cps.h:79
lbm_value r
Definition: eval_cps.h:71
struct eval_context_s eval_context_t
void(* ctx_fun)(eval_context_t *, void *, void *)
Definition: eval_cps.h:114
void lbm_pause_eval_with_gc(uint32_t num_free)
Definition: eval_cps.c:5045
void lbm_set_usleep_callback(void(*fptr)(uint32_t))
Definition: eval_cps.c:280
lbm_value curr_env
Definition: eval_cps.h:66
lbm_value eval_cps_get_env(void)
void lbm_set_critical_error_callback(void(*fptr)(void))
Definition: eval_cps.c:275
void lbm_running_iterator(ctx_fun f, void *, void *)
Definition: eval_cps.c:876
Definition: eval_cps.h:63
lbm_int row0
Definition: eval_cps.h:82
bool lbm_event_run_user_callback(void *arg)
Definition: eval_cps.c:351
uint32_t num_mail
Definition: eval_cps.h:69
void lbm_toggle_verbose(void)
Definition: eval_cps.c:419
bool lbm_event_handler_exists(void)
Definition: eval_cps.c:322
lbm_event_type_t type
Definition: eval_cps.h:97
uint32_t lbm_value
Definition: lbm_types.h:44
int32_t lbm_int
Definition: lbm_types.h:49
Definition: eval_cps.h:96
bool lbm_unblock_ctx_unboxed(lbm_cid cid, lbm_value unboxed)
Definition: eval_cps.c:1360
void lbm_set_dynamic_load_callback(bool(*fptr)(const char *, const char **))
Definition: eval_cps.c:300
void lbm_set_event_handler_pid(lbm_cid pid)
Definition: eval_cps.c:318
void lbm_continue_eval(void)
Definition: eval_cps.c:5051
struct eval_context_s * next
Definition: eval_cps.h:86
int32_t lbm_cid
Definition: lbm_types.h:64
bool lbm_unblock_ctx(lbm_cid cid, lbm_flat_value_t *fv)
Definition: eval_cps.c:1338
bool lbm_eval_init_events(unsigned int num_events)
Definition: eval_cps.c:5271
@ LBM_EVENT_DEFINE
Definition: eval_cps.h:92
void lbm_set_ctx_done_callback(void(*fptr)(eval_context_t *))
Definition: eval_cps.c:290
lbm_value program
Definition: eval_cps.h:64
bool lbm_mailbox_change_size(eval_context_t *ctx, lbm_uint new_size)
Definition: eval_cps.c:1278
void lbm_set_eval_step_quota(uint32_t quota)
Definition: eval_cps.c:221
lbm_value(* fundamental_fun)(lbm_value *, lbm_uint, eval_context_t *)
Definition: eval_cps.h:104
lbm_cid parent
Definition: eval_cps.h:80
lbm_cid lbm_create_ctx(lbm_value program, lbm_value env, lbm_uint stack_size, char *name)
Definition: eval_cps.c:1268
void lbm_blocked_iterator(ctx_fun f, void *, void *)
Definition: eval_cps.c:882