diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-11 13:32:59 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-11 13:32:59 +0000 |
commit | e5fe0c5230cc7780de852cefb5df57e05e2c613e (patch) | |
tree | e9336966c143de451ee699c37714200ce9f96079 /linux-user/qemu.h | |
parent | ac62f715c6b8bde0fc4cfb0bed8e4f12ad4b5503 (diff) |
bFLT loader (for uClinux binaries).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1951 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/qemu.h')
-rw-r--r-- | linux-user/qemu.h | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 7c7bcf34e6..9047fcf14e 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -18,6 +18,7 @@ struct image_info { unsigned long start_code; unsigned long end_code; + unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; @@ -25,10 +26,6 @@ struct image_info { unsigned long mmap; unsigned long rss; unsigned long start_stack; - unsigned long arg_start; - unsigned long arg_end; - unsigned long env_start; - unsigned long env_end; unsigned long entry; int personality; }; @@ -82,9 +79,43 @@ typedef struct TaskState { extern TaskState *first_task_state; extern const char *qemu_uname_release; -int elf_exec(const char * filename, char ** argv, char ** envp, +/* ??? See if we can avoid exposing so much of the loader internals. */ +/* + * MAX_ARG_PAGES defines the number of pages allocated for arguments + * and envelope for the new program. 32 should suffice, this gives + * a maximum env+arg of 128kB w/4KB pages! + */ +#define MAX_ARG_PAGES 32 + +/* + * This structure is used to hold the arguments that are + * used when loading binaries. + */ +struct linux_binprm { + char buf[128]; + void *page[MAX_ARG_PAGES]; + unsigned long p; + int fd; + int e_uid, e_gid; + int argc, envc; + char **argv; + char **envp; + char * filename; /* Name of binary */ +}; + +void do_init_thread(struct target_pt_regs *regs, struct image_info *infop); +target_ulong loader_build_argptr(int envc, int argc, target_ulong sp, + target_ulong stringp, int push_ptr); +int loader_exec(const char * filename, char ** argv, char ** envp, struct target_pt_regs * regs, struct image_info *infop); +int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, + struct image_info * info); +int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, + struct image_info * info); + +void memcpy_to_target(target_ulong dest, const void *src, + unsigned long len); void target_set_brk(target_ulong new_brk); long do_brk(target_ulong new_brk); void syscall_init(void); |