From a4c075f178a3a2c976667389f19ce7dbabaf9712 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Fri, 24 Jul 2009 16:57:31 +0200 Subject: s390x: s390x-linux-user support This patch adds support for running s390x binaries in the linux-user emulation code. Signed-off-by: Ulrich Hecht Signed-off-by: Alexander Graf --- linux-user/elfload.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'linux-user/elfload.c') 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 -- cgit v1.2.1