x86: Define a local ABI for system calls.

These ABIs (one 32 bit and one 64 bit) take advantage of the
GenericSyscallABI and X86Linux::SyscallABI partial ABIs set up earlier.

This removes x86's dependence on the getSyscallArg and setSyscallReturn
Process methods.

Change-Id: Ia07834cea1afa827d77e590af5397e2a1e0e2099
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23443
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2019-12-06 17:46:38 -08:00
parent 8c594cfbdb
commit 112e1cdfca
3 changed files with 50 additions and 6 deletions

View File

@@ -65,9 +65,7 @@ class X86Linux : public Linux
ctc->setIntReg(X86ISA::StackPointerReg, stack);
}
class SyscallABI
{
};
class SyscallABI {};
};
namespace GuestABI
@@ -81,7 +79,10 @@ struct Result<ABI, SyscallReturn,
static void
store(ThreadContext *tc, const SyscallReturn &ret)
{
tc->setIntReg(ABI::ReturnValueReg, ret.encodedValue());
if (ret.suppressed() || ret.needsRetry())
return;
tc->setIntReg(X86ISA::INTREG_RAX, ret.encodedValue());
}
};