7 #include "syscall_defs.h"
11 #include "syscall-i386.h"
14 /* This struct is used to hold certain information about the image.
15 * Basically, it replicates in user space what would be certain
16 * task_struct fields in the kernel
19 unsigned long start_code;
20 unsigned long end_code;
21 unsigned long end_data;
22 unsigned long start_brk;
24 unsigned long start_mmap;
27 unsigned long start_stack;
28 unsigned long arg_start;
29 unsigned long arg_end;
30 unsigned long env_start;
31 unsigned long env_end;
36 /* Information about the current linux thread */
37 struct vm86_saved_state {
38 uint32_t eax; /* return code */
48 uint16_t cs, ss, ds, es, fs, gs;
51 /* NOTE: we force a big alignment so that the stack stored after is
53 typedef struct TaskState {
54 struct TaskState *next;
55 struct target_vm86plus_struct *target_v86;
56 struct vm86_saved_state vm86_saved_regs;
57 struct target_vm86plus_struct vm86plus;
60 int used; /* non zero if used */
62 } __attribute__((aligned(16))) TaskState;
64 extern TaskState *first_task_state;
66 int elf_exec(const char * filename, char ** argv, char ** envp,
67 struct target_pt_regs * regs, struct image_info *infop);
69 void target_set_brk(char *new_brk);
70 void syscall_init(void);
71 long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
72 long arg4, long arg5, long arg6);
73 void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2)));
74 extern CPUX86State *global_env;
75 void cpu_loop(CPUX86State *env);
76 void process_pending_signals(void *cpu_env);
77 void signal_init(void);
78 int queue_signal(int sig, target_siginfo_t *info);
79 void init_paths(const char *prefix);
80 const char *path(const char *pathname);
86 void save_v86_state(CPUX86State *env);
87 void handle_vm86_trap(CPUX86State *env, int trapno);
88 void handle_vm86_fault(CPUX86State *env);
89 int do_vm86(CPUX86State *env, long subfunction,
90 struct target_vm86plus_struct * target_v86);
93 int target_mprotect(unsigned long start, unsigned long len, int prot);
94 long target_mmap(unsigned long start, unsigned long len, int prot,
95 int flags, int fd, unsigned long offset);
96 int target_munmap(unsigned long start, unsigned long len);
97 long target_mremap(unsigned long old_addr, unsigned long old_size,
98 unsigned long new_size, unsigned long flags,
99 unsigned long new_addr);
100 int target_msync(unsigned long start, unsigned long len, int flags);