summary refs log tree commit diff stats
path: root/linux-user/qemu.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/qemu.h')
-rw-r--r--linux-user/qemu.h41
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);