7 #include "syscall_defs.h"
9 #if defined(TARGET_I386)
11 #include "syscall-i386.h"
12 #elif defined(TARGET_ARM)
14 #include "syscall-arm.h"
16 #error unsupported target CPU
19 /* This struct is used to hold certain information about the image.
20 * Basically, it replicates in user space what would be certain
21 * task_struct fields in the kernel
24 unsigned long start_code;
25 unsigned long end_code;
26 unsigned long end_data;
27 unsigned long start_brk;
29 unsigned long start_mmap;
32 unsigned long start_stack;
33 unsigned long arg_start;
34 unsigned long arg_end;
35 unsigned long env_start;
36 unsigned long env_end;
42 /* Information about the current linux thread */
43 struct vm86_saved_state {
44 uint32_t eax; /* return code */
54 uint16_t cs, ss, ds, es, fs, gs;
58 /* NOTE: we force a big alignment so that the stack stored after is
60 typedef struct TaskState {
61 struct TaskState *next;
63 struct target_vm86plus_struct *target_v86;
64 struct vm86_saved_state vm86_saved_regs;
65 struct target_vm86plus_struct vm86plus;
69 int used; /* non zero if used */
71 } __attribute__((aligned(16))) TaskState;
73 extern TaskState *first_task_state;
75 int elf_exec(const char * filename, char ** argv, char ** envp,
76 struct target_pt_regs * regs, struct image_info *infop);
78 void target_set_brk(char *new_brk);
79 void syscall_init(void);
80 long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
81 long arg4, long arg5, long arg6);
82 void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2)));
83 extern CPUState *global_env;
84 void cpu_loop(CPUState *env);
85 void init_paths(const char *prefix);
86 const char *path(const char *pathname);
92 void process_pending_signals(void *cpu_env);
93 void signal_init(void);
94 int queue_signal(int sig, target_siginfo_t *info);
95 void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info);
96 void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo);
97 long do_sigreturn(CPUState *env);
98 long do_rt_sigreturn(CPUState *env);
102 void save_v86_state(CPUX86State *env);
103 void handle_vm86_trap(CPUX86State *env, int trapno);
104 void handle_vm86_fault(CPUX86State *env);
105 int do_vm86(CPUX86State *env, long subfunction,
106 struct target_vm86plus_struct * target_v86);
110 int target_mprotect(unsigned long start, unsigned long len, int prot);
111 long target_mmap(unsigned long start, unsigned long len, int prot,
112 int flags, int fd, unsigned long offset);
113 int target_munmap(unsigned long start, unsigned long len);
114 long target_mremap(unsigned long old_addr, unsigned long old_size,
115 unsigned long new_size, unsigned long flags,
116 unsigned long new_addr);
117 int target_msync(unsigned long start, unsigned long len, int flags);