1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef LINUX_USER_LOADER_H
19#define LINUX_USER_LOADER_H
20
21
22
23
24
25#define BPRM_BUF_SIZE 1024
26
27
28
29
30
31struct linux_binprm {
32 char buf[BPRM_BUF_SIZE] __attribute__((aligned));
33 abi_ulong p;
34 int fd;
35 int e_uid, e_gid;
36 int argc, envc;
37 char **argv;
38 char **envp;
39 char *filename;
40 int (*core_dump)(int, const CPUArchState *);
41};
42
43void do_init_thread(struct target_pt_regs *regs, struct image_info *infop);
44abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
45 abi_ulong stringp, int push_ptr);
46int loader_exec(int fdexec, const char *filename, char **argv, char **envp,
47 struct target_pt_regs *regs, struct image_info *infop,
48 struct linux_binprm *);
49
50uint32_t get_elf_eflags(int fd);
51int load_elf_binary(struct linux_binprm *bprm, struct image_info *info);
52int load_flt_binary(struct linux_binprm *bprm, struct image_info *info);
53
54abi_long memcpy_to_target(abi_ulong dest, const void *src,
55 unsigned long len);
56
57extern unsigned long guest_stack_size;
58
59#endif
60