diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-11-23 17:05:30 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-11-23 17:05:30 +0000 |
commit | 678673089d1ba7cd0f2960a2815a0d5bb8a72fa3 (patch) | |
tree | a1c8fa862f3da0189e71fd866f5e5717f60caa70 /linux-user/elfload.c | |
parent | 28b6751f30603a4c7146282fde9efcf8b5f31f7b (diff) |
PowerPC target support (Jocelyn Mayer) - added better support for uid16
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@474 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r-- | linux-user/elfload.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a0e205cd67..a7a2f61eb4 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -104,6 +104,46 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i #endif +#ifdef TARGET_PPC + +#define ELF_START_MMAP 0x80000000 + +#define elf_check_arch(x) ( (x) == EM_PPC ) + +#define ELF_CLASS ELFCLASS32 +#ifdef TARGET_WORDS_BIGENDIAN +#define ELF_DATA ELFDATA2MSB +#else +#define ELF_DATA ELFDATA2LSB +#endif +#define ELF_ARCH EM_PPC + +/* Note that isn't exactly what regular kernel does + * but this is what the ABI wants and is needed to allow + * execution of PPC BSD programs. + */ +#define ELF_PLAT_INIT(_r) \ +do { \ + unsigned long *pos = (unsigned long *)bprm->p, tmp = 1; \ + _r->gpr[3] = bprm->argc; \ + _r->gpr[4] = (unsigned long)++pos; \ + for (; tmp != 0; pos++) \ + tmp = *pos; \ + _r->gpr[5] = (unsigned long)pos; \ +} while (0) + +static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop) +{ + _regs->msr = 1 << MSR_PR; /* Set user mode */ + _regs->gpr[1] = infop->start_stack; + _regs->nip = infop->entry; +} + +#define USE_ELF_CORE_DUMP +#define ELF_EXEC_PAGESIZE 4096 + +#endif + #include "elf.h" /* |