#ifndef __CPU_EXEC_H #define __CPU_EXEC_H #include #include "mcpu-asm.h" typedef struct cpu_exec_options { __mpu_uint64_t stack_size; int have_heap; __mpu_uint64_t heap_size; __mpu_uint64_t heap_limit; } cpu_exec_options; typedef struct cpu_exec_loaded { int has_init; int has_fini; __mpu_uint64_t start_entry; __mpu_uint64_t init_entry; __mpu_uint64_t life_entry; __mpu_uint64_t fini_entry; __mpu_uint64_t startup_base; __mpu_uint64_t stack_size; int has_data_section; __mpu_uint64_t data_section_begin; __mpu_uint64_t data_section_size; } cpu_exec_loaded; int cpu_exec_write( const char *path, const cpu_asm_image *image, const cpu_exec_options *options, char *err, size_t errsz); int cpu_exec_load( const char *path, int argc, char **argv, cpu_exec_loaded *loaded, char *err, size_t errsz); int cpu_exec_abi_version( const char *path, unsigned *abi, char *err, size_t errsz ); int cpu_exec_load_preload( const char *path, const char *preload_list, int argc, char **argv, cpu_exec_loaded *loaded, char *err, size_t errsz); int cpu_exec_load_resolved( const char *path, const char *module_list, size_t preload_count, int argc, char **argv, cpu_exec_loaded *loaded, char *err, size_t errsz ); #endif