LispBM
|
#include <extensions.h>
#include <lbm_image.h>
#include <heap.h>
#include <env.h>
#include <lbm_flat_value.h>
#include <eval_cps.h>
Macros | |
#define | IMAGE_INITIALIZED (uint32_t)0xBEEF2001 |
#define | CONSTANT_HEAP_IX (uint32_t)0x02 |
#define | BINDING_CONST (uint32_t)0x03 |
#define | BINDING_FLAT (uint32_t)0x04 |
#define | STARTUP_ENTRY (uint32_t)0x05 |
#define | SYMBOL_ENTRY (uint32_t)0x06 |
#define | SYMBOL_LINK_ENTRY (uint32_t)0x07 |
#define | EXTENSION_TABLE (uint32_t)0x08 |
#define | VERSION_ENTRY (uint32_t)0x09 |
#define | DOWNWARDS true |
#define | UPWARDS false |
Functions | |
uint32_t * | lbm_image_get_image (void) |
uint32_t | lbm_image_get_size (void) |
int32_t | lbm_image_get_write_index (void) |
bool | lbm_image_has_extensions (void) |
uint32_t | read_u32 (int32_t index) |
uint64_t | read_u64 (int32_t index) |
bool | write_u32 (uint32_t w, int32_t *i, bool direction) |
bool | write_u64 (uint64_t dw, int32_t *i, bool direction) |
bool | fv_write_u8 (uint8_t b) |
bool | fv_write_flush (void) |
bool | fv_write_u32 (uint32_t w) |
bool | fv_write_u64 (uint64_t dw) |
bool | write_lbm_uint (lbm_uint ptr_val, int32_t *i, bool direction) |
bool | write_lbm_value (lbm_value v, int32_t *i, bool direction) |
static bool | i_f_cons (void) |
static bool | i_f_lisp_array (uint32_t size) |
static bool | i_f_sym (lbm_value sym) |
static bool | i_f_i (lbm_int i) |
static bool | i_f_u (lbm_uint u) |
static bool | i_f_b (uint8_t b) |
static bool | i_f_i32 (int32_t w) |
static bool | i_f_u32 (uint32_t w) |
static bool | i_f_float (float f) |
static bool | i_f_double (double d) |
static bool | i_f_i64 (int64_t w) |
static bool | i_f_u64 (uint64_t w) |
static bool | i_f_lbm_array (uint32_t num_bytes, uint8_t *data) |
static bool | image_flatten_value (lbm_value v) |
char * | lbm_image_get_version (void) |
bool | image_const_heap_write (lbm_uint w, lbm_uint ix) |
lbm_uint * | lbm_image_add_symbol (char *name, lbm_uint id, lbm_uint symlist) |
lbm_uint * | lbm_image_add_and_link_symbol (char *name, lbm_uint id, lbm_uint symlist, lbm_uint *link) |
bool | lbm_image_save_global_env (void) |
bool | lbm_image_save_extensions (void) |
bool | lbm_image_save_constant_heap_ix (void) |
bool | lbm_image_exists (void) |
void | lbm_image_init (uint32_t *image_mem_address, uint32_t image_size_words, lbm_image_write_fun image_write_fun) |
void | lbm_image_create (char *version_str) |
bool | lbm_image_boot (void) |
Variables | |
static lbm_image_write_fun | image_write = NULL |
static uint32_t * | image_address = NULL |
static int32_t | write_index = 0 |
static uint32_t | image_size = 0 |
static bool | image_has_extensions = false |
static char * | image_version = NULL |
uint32_t | fv_buf_ix = 0 |
uint8_t | fv_buf [4] = {0} |
lbm_const_heap_t | image_const_heap |
lbm_uint | image_const_heap_start_ix = 0 |
static uint32_t | last_const_heap_ix = 0 |
#define BINDING_CONST (uint32_t)0x03 |
#define BINDING_FLAT (uint32_t)0x04 |
#define CONSTANT_HEAP_IX (uint32_t)0x02 |
#define DOWNWARDS true |
#define EXTENSION_TABLE (uint32_t)0x08 |
#define IMAGE_INITIALIZED (uint32_t)0xBEEF2001 |
#define STARTUP_ENTRY (uint32_t)0x05 |
#define SYMBOL_ENTRY (uint32_t)0x06 |
#define SYMBOL_LINK_ENTRY (uint32_t)0x07 |
#define UPWARDS false |
#define VERSION_ENTRY (uint32_t)0x09 |
bool fv_write_flush | ( | void | ) |
bool fv_write_u32 | ( | uint32_t | w | ) |
bool fv_write_u64 | ( | uint64_t | dw | ) |
bool fv_write_u8 | ( | uint8_t | b | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
lbm_uint * lbm_image_add_and_link_symbol | ( | char * | name, |
lbm_uint | id, | ||
lbm_uint | symlist, | ||
lbm_uint * | link | ||
) |
Add a symbol to the image and "link" it to a C address (variable).
name | Symbol name. |
id | Symbol id. |
symlist | Ptr to rest of symbol list. |
link | ptr where to store the symbol ID on image-boot. |
Add a symbol to the image. Symbols added to the image are restored upon image-boot.
name | Symbol name. |
id | Symbol id. |
symlist | Ptr to rest of symbol list. |
bool lbm_image_boot | ( | void | ) |
Boot an existing image. Restores the datastructures stored in the image.
void lbm_image_create | ( | char * | version_str | ) |
Create an image at the address and of the size given to lbm_image_init.
version_str | a zero terminated version string or NULL. |
bool lbm_image_exists | ( | void | ) |
An image exists the memory area given to lbm_image_init to store the image in contains the IMAGE_INITIALIZED field at the start (top) of the image area.
uint32_t * lbm_image_get_image | ( | void | ) |
lbm_image_get_image provides a pointer to the starting point of an image. The starting point of an image is the lowest address, even though writing to an image is done top-down.
uint32_t lbm_image_get_size | ( | void | ) |
Get the size of an image.
char * lbm_image_get_version | ( | void | ) |
Get the version string that was stored in the image. If no version string was stored in the image, the result is NULL.
int32_t lbm_image_get_write_index | ( | void | ) |
Images are written from the top towards the bottom. The write_index is the next free location of (32bit) word size in the image.
bool lbm_image_has_extensions | ( | void | ) |
Does the image have a stored extension table?
void lbm_image_init | ( | uint32_t * | image_mem_address, |
uint32_t | image_size_words, | ||
lbm_image_write_fun | image_write_fun | ||
) |
bool lbm_image_save_constant_heap_ix | ( | void | ) |
Save the current constant_heap index into the image for recovery upon restart.
bool lbm_image_save_extensions | ( | void | ) |
Save the extension table to the image.
bool lbm_image_save_global_env | ( | void | ) |
Save the global environment to the image.
uint32_t read_u32 | ( | int32_t | index | ) |
uint64_t read_u64 | ( | int32_t | index | ) |
bool write_lbm_uint | ( | lbm_uint | ptr_val, |
int32_t * | i, | ||
bool | direction | ||
) |
bool write_lbm_value | ( | lbm_value | v, |
int32_t * | i, | ||
bool | direction | ||
) |
bool write_u32 | ( | uint32_t | w, |
int32_t * | i, | ||
bool | direction | ||
) |
bool write_u64 | ( | uint64_t | dw, |
int32_t * | i, | ||
bool | direction | ||
) |
uint8_t fv_buf[4] = {0} |
uint32_t fv_buf_ix = 0 |
|
static |
lbm_const_heap_t image_const_heap |
lbm_uint image_const_heap_start_ix = 0 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |