summaryrefslogtreecommitdiff
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-01-30 22:59:18 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-01-30 22:59:18 +0000
commita315a14547b07377eb30a517ffcd2344a819266d (patch)
treedff04cb33dba1d308c6b75fc75fe2bbd49aec76c /linux-user/elfload.c
parent4fa5d7722db71a4bd6f01e607cf01c758c150dd1 (diff)
downloadqemu-a315a14547b07377eb30a517ffcd2344a819266d.tar.gz
initial sparc64 support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1256 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 09c33aa90b..684e70eeb8 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -94,11 +94,33 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
#endif
#ifdef TARGET_SPARC
+#ifdef TARGET_SPARC64
#define ELF_START_MMAP 0x80000000
#define elf_check_arch(x) ( (x) == EM_SPARC )
+#define ELF_CLASS ELFCLASS64
+#define ELF_DATA ELFDATA2MSB
+#define ELF_ARCH EM_SPARC
+
+/*XXX*/
+#define ELF_PLAT_INIT(_r)
+
+static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
+{
+ regs->tstate = 0;
+ regs->pc = infop->entry;
+ regs->npc = regs->pc + 4;
+ regs->y = 0;
+ regs->u_regs[14] = infop->start_stack - 16 * 4;
+}
+
+#else
+#define ELF_START_MMAP 0x80000000
+
+#define elf_check_arch(x) ( (x) == EM_SPARC )
+
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_SPARC
@@ -116,6 +138,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
}
#endif
+#endif
#ifdef TARGET_PPC