fa40d4d84553079b0487e1e143b3a1da677e866c
[qemu] / linux-user / qemu.h
1 #ifndef GEMU_H
2 #define GEMU_H
3
4 #include "thunk.h"
5
6 struct pt_regs {
7         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  */
28 struct 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
46 int elf_exec(const char * filename, char ** argv, char ** envp, 
47              struct pt_regs * regs, struct image_info *infop);
48
49 void target_set_brk(char *new_brk);
50 void syscall_init(void);
51 long do_syscall(int num, long arg1, long arg2, long arg3, 
52                 long arg4, long arg5, long arg6);
53 void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2)));
54
55
56
57 #endif