aboutsummaryrefslogtreecommitdiff
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-26 18:47:20 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-26 18:47:20 +0000
commit048f6b4df7ca3be292f40f7f56fd4e48edcabbe9 (patch)
tree2d297f570bdc37d620a882181d2dcf8917fcc8b8 /linux-user/elfload.c
parenteeef26cd428b584a8211cc42185585c840b778f4 (diff)
mips user emulation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1668 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index eda6e9ba23..f1af656dc0 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -247,6 +247,31 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *
#endif
+#ifdef TARGET_MIPS
+
+#define ELF_START_MMAP 0x80000000
+
+#define elf_check_arch(x) ( (x) == EM_MIPS )
+
+#define ELF_CLASS ELFCLASS32
+#ifdef TARGET_WORDS_BIGENDIAN
+#define ELF_DATA ELFDATA2MSB
+#else
+#define ELF_DATA ELFDATA2LSB
+#endif
+#define ELF_ARCH EM_MIPS
+
+#define ELF_PLAT_INIT(_r)
+
+static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
+{
+ regs->cp0_status = CP0St_UM;
+ regs->cp0_epc = infop->entry;
+ regs->regs[29] = infop->start_stack;
+}
+
+#endif /* TARGET_MIPS */
+
#ifndef ELF_PLATFORM
#define ELF_PLATFORM (NULL)
#endif