RISC-V: linux-user support for RVE ABI

This change checks elf_flags for EF_RISCV_RVE and if
present uses the RVE linux syscall ABI which uses t0
for the syscall number instead of a7.

Warn and exit if a non-RVE ABI binary is run on a
cpu with the RVE extension as it is incompatible.

Backports relevant parts of 5836c3eccedb6dfab16b8f606f2de24b8938b69c
from qemu
This commit is contained in:
Kito Cheng 2019-03-19 23:56:43 -04:00 committed by Lioncash
parent 2e0c040062
commit bd3e9ebaea
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 6 additions and 1 deletions

View file

@ -125,6 +125,10 @@ struct CPURISCVState {
uint32_t features;
#ifdef CONFIG_USER_ONLY
uint32_t elf_flags;
#endif
#ifndef CONFIG_USER_ONLY
target_ulong priv;
target_ulong resetvec;

View file

@ -10,4 +10,5 @@
#define xA4 14
#define xA5 15
#define xA6 16
#define xA7 17 /* syscall number goes here */
#define xA7 17 /* syscall number for RVI ABI */
#define xT0 5 /* syscall number for RVE ABI */