diff options
| author | Michael Clark | 2018-03-02 13:31:11 +0100 |
|---|---|---|
| committer | Michael Clark | 2018-03-06 20:30:28 +0100 |
| commit | 47ae93cdfedc683c56e19113d516d7ce4971c8e6 (patch) | |
| tree | 713240f8392d981ec9b11893d603475f7a5dcfa5 /linux-user/elfload.c | |
| parent | RISC-V Physical Memory Protection (diff) | |
| download | qemu-47ae93cdfedc683c56e19113d516d7ce4971c8e6.tar.gz qemu-47ae93cdfedc683c56e19113d516d7ce4971c8e6.tar.xz qemu-47ae93cdfedc683c56e19113d516d7ce4971c8e6.zip | |
RISC-V Linux User Emulation
Implementation of linux user emulation for RISC-V.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Sagar Karandikar <sagark@eecs.berkeley.edu>
Signed-off-by: Michael Clark <mjc@sifive.com>
Diffstat (limited to 'linux-user/elfload.c')
| -rw-r--r-- | linux-user/elfload.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e3689c658a..5fc130cc20 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1295,6 +1295,28 @@ static inline void init_thread(struct target_pt_regs *regs, #endif /* TARGET_TILEGX */ +#ifdef TARGET_RISCV + +#define ELF_START_MMAP 0x80000000 +#define ELF_ARCH EM_RISCV + +#ifdef TARGET_RISCV32 +#define ELF_CLASS ELFCLASS32 +#else +#define ELF_CLASS ELFCLASS64 +#endif + +static inline void init_thread(struct target_pt_regs *regs, + struct image_info *infop) +{ + regs->sepc = infop->entry; + regs->sp = infop->start_stack; +} + +#define ELF_EXEC_PAGESIZE 4096 + +#endif /* TARGET_RISCV */ + #ifdef TARGET_HPPA #define ELF_START_MMAP 0x80000000 |
