LispBM
Loading...
Searching...
No Matches
Typedefs | Functions
lbm_image.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef bool(* lbm_image_write_fun) (uint32_t data, int32_t index, bool const_heap)
 

Functions

uint32_t * lbm_image_get_image (void)
 
int32_t lbm_image_get_write_index (void)
 
uint32_t lbm_image_get_size (void)
 
bool lbm_image_has_extensions (void)
 
bool lbm_image_save_global_env (void)
 
bool lbm_image_save_extensions (void)
 
bool lbm_image_save_constant_heap_ix (void)
 
lbm_uintlbm_image_add_symbol (char *name, lbm_uint id, lbm_uint symlist)
 
lbm_uintlbm_image_add_and_link_symbol (char *name, lbm_uint id, lbm_uint symlist, lbm_uint *link)
 
void lbm_image_init (uint32_t *image_mem_addr, uint32_t image_size, lbm_image_write_fun image_write_fun)
 
void lbm_image_create (char *version_str)
 
bool lbm_image_exists (void)
 
bool lbm_image_boot (void)
 
char * lbm_image_get_version (void)
 

Typedef Documentation

◆ lbm_image_write_fun

typedef bool(* lbm_image_write_fun) (uint32_t data, int32_t index, bool const_heap)

lbm_image_write_fun function ptr.

Parameters
data32bit word to write.
indexPosition to write to.
const_heapTrue if writing to const heap (bottom of image) and false otherwise.

Function Documentation

◆ lbm_image_add_and_link_symbol()

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).

Parameters
nameSymbol name.
idSymbol id.
symlistPtr to rest of symbol list.
linkptr where to store the symbol ID on image-boot.
Returns
pointer to head of symbol list.

◆ lbm_image_add_symbol()

lbm_uint * lbm_image_add_symbol ( char *  name,
lbm_uint  id,
lbm_uint  symlist 
)

Add a symbol to the image. Symbols added to the image are restored upon image-boot.

Parameters
nameSymbol name.
idSymbol id.
symlistPtr to rest of symbol list.
Returns
pointer to head of symbol list.

◆ lbm_image_boot()

bool lbm_image_boot ( void  )

Boot an existing image. Restores the datastructures stored in the image.

Returns
true on success, false otherwise.

◆ lbm_image_create()

void lbm_image_create ( char *  version_str)

Create an image at the address and of the size given to lbm_image_init.

Parameters
version_stra zero terminated version string or NULL.

◆ lbm_image_exists()

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.

Returns
true if image exists, false otherwise.

◆ lbm_image_get_image()

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.

Returns
pointer to image.

◆ lbm_image_get_size()

uint32_t lbm_image_get_size ( void  )

Get the size of an image.

Returns
The size of the image in 32bit words

◆ lbm_image_get_version()

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.

Returns
pointer to version string or NULL.

◆ lbm_image_get_write_index()

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.

Returns
write index.

◆ lbm_image_has_extensions()

bool lbm_image_has_extensions ( void  )

Does the image have a stored extension table?

Returns
true if image contains extension table, false otherwise.

◆ lbm_image_init()

void lbm_image_init ( uint32_t *  image_mem_addr,
uint32_t  image_size,
lbm_image_write_fun  image_write_fun 
)

◆ lbm_image_save_constant_heap_ix()

bool lbm_image_save_constant_heap_ix ( void  )

Save the current constant_heap index into the image for recovery upon restart.

Returns
true on success otherwise false.

◆ lbm_image_save_extensions()

bool lbm_image_save_extensions ( void  )

Save the extension table to the image.

Returns
true on success otherwise false.

◆ lbm_image_save_global_env()

bool lbm_image_save_global_env ( void  )

Save the global environment to the image.

Returns
true on success otherwise false.