arch-riscv,sim-se: Support RV32 register ABI call

1. Add RegABI32, SyscallABI32
2. Support parse function arguments to host and save result to registers
3. Add write to ThreadPointerReg in archClone
4. Support RV32 M5Op syscall

Change-Id: Ie327b517f41b5d633d2741b6abb5be955281c838
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65532
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Roger Chang
2022-11-15 13:48:53 +00:00
parent e4be93b55f
commit f2562152e8
7 changed files with 67 additions and 10 deletions

View File

@@ -371,8 +371,10 @@ class RiscvLinux32 : public RiscvLinux, public OpenFlagTable<RiscvLinux32>
uint64_t stack, uint64_t tls)
{
ctc->getIsaPtr()->copyRegsFrom(ptc);
if (flags & TGT_CLONE_SETTLS)
ctc->setReg(RiscvISA::ThreadPointerReg, sext<32>(tls));
if (stack)
ctc->setReg(RiscvISA::StackPointerReg, stack);
ctc->setReg(RiscvISA::StackPointerReg, sext<32>(stack));
}
};

View File

@@ -123,7 +123,7 @@ unameFunc32(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
return 0;
}
SyscallDescTable<SEWorkload::SyscallABI> EmuLinux::syscallDescs64 = {
SyscallDescTable<SEWorkload::SyscallABI64> EmuLinux::syscallDescs64 = {
{ 0, "io_setup" },
{ 1, "io_destroy" },
{ 2, "io_submit" },
@@ -462,7 +462,7 @@ SyscallDescTable<SEWorkload::SyscallABI> EmuLinux::syscallDescs64 = {
{ 2011, "getmainvars" }
};
SyscallDescTable<SEWorkload::SyscallABI> EmuLinux::syscallDescs32 = {
SyscallDescTable<SEWorkload::SyscallABI32> EmuLinux::syscallDescs32 = {
{ 0, "io_setup" },
{ 1, "io_destroy" },
{ 2, "io_submit" },

View File

@@ -47,10 +47,10 @@ class EmuLinux : public SEWorkload
protected:
/// 64 bit syscall descriptors, indexed by call number.
static SyscallDescTable<SEWorkload::SyscallABI> syscallDescs64;
static SyscallDescTable<SEWorkload::SyscallABI64> syscallDescs64;
/// 32 bit syscall descriptors, indexed by call number.
static SyscallDescTable<SEWorkload::SyscallABI> syscallDescs32;
static SyscallDescTable<SEWorkload::SyscallABI32> syscallDescs32;
public:
using Params = RiscvEmuLinuxParams;