summaryrefslogtreecommitdiff
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorUlrich Hecht <uli@suse.de>2009-07-24 16:57:31 +0200
committerAlexander Graf <agraf@suse.de>2011-05-20 17:35:12 +0200
commita4c075f178a3a2c976667389f19ce7dbabaf9712 (patch)
tree4f54e1b2c9b03cde9ae821f7f6821669a1bef1c4 /linux-user/elfload.c
parent7a86d29a7e16e738d749cfece8857d8902790875 (diff)
downloadqemu-a4c075f178a3a2c976667389f19ce7dbabaf9712.tar.gz
s390x: s390x-linux-user support
This patch adds support for running s390x binaries in the linux-user emulation code. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 4c399f8e33..dcfeb7a286 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -867,6 +867,25 @@ static inline void init_thread(struct target_pt_regs *regs,
#endif /* TARGET_ALPHA */
+#ifdef TARGET_S390X
+
+#define ELF_START_MMAP (0x20000000000ULL)
+
+#define elf_check_arch(x) ( (x) == ELF_ARCH )
+
+#define ELF_CLASS ELFCLASS64
+#define ELF_DATA ELFDATA2MSB
+#define ELF_ARCH EM_S390
+
+static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
+{
+ regs->psw.addr = infop->entry;
+ regs->psw.mask = PSW_MASK_64 | PSW_MASK_32;
+ regs->gprs[15] = infop->start_stack;
+}
+
+#endif /* TARGET_S390X */
+
#ifndef ELF_PLATFORM
#define ELF_PLATFORM (NULL)
#endif