blob: 0b9de6b3fe27093520d6e7cb32bd3ade21630e6b [file] [log] [blame]
bellard31e31b82003-02-18 22:55:36 +00001#ifndef GEMU_H
2#define GEMU_H
3
4#include "thunk.h"
5
bellard01ffc752003-02-18 23:00:51 +00006struct target_pt_regs {
bellard31e31b82003-02-18 22:55:36 +00007 long ebx;
8 long ecx;
9 long edx;
10 long esi;
11 long edi;
12 long ebp;
13 long eax;
14 int xds;
15 int xes;
16 long orig_eax;
17 long eip;
18 int xcs;
19 long eflags;
20 long esp;
21 int xss;
22};
23
24/* This struct is used to hold certain information about the image.
25 * Basically, it replicates in user space what would be certain
26 * task_struct fields in the kernel
27 */
28struct image_info {
29 unsigned long start_code;
30 unsigned long end_code;
31 unsigned long end_data;
32 unsigned long start_brk;
33 unsigned long brk;
34 unsigned long start_mmap;
35 unsigned long mmap;
36 unsigned long rss;
37 unsigned long start_stack;
38 unsigned long arg_start;
39 unsigned long arg_end;
40 unsigned long env_start;
41 unsigned long env_end;
42 unsigned long entry;
43 int personality;
44};
45
46int elf_exec(const char * filename, char ** argv, char ** envp,
bellard01ffc752003-02-18 23:00:51 +000047 struct target_pt_regs * regs, struct image_info *infop);
bellard31e31b82003-02-18 22:55:36 +000048
49void target_set_brk(char *new_brk);
50void syscall_init(void);
51long do_syscall(int num, long arg1, long arg2, long arg3,
52 long arg4, long arg5, long arg6);
53void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2)));
54
55
56
57#endif