summaryrefslogtreecommitdiff
path: root/utils/mcpu-exec.h
blob: 19a2be168b3f67a609d562e18e3c4b647fb58e5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __CPU_EXEC_H
#define __CPU_EXEC_H

#include <stddef.h>
#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