diff options
author | Gabe Black <gabeblack@google.com> | 2019-11-25 02:53:47 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2020-01-06 23:45:53 +0000 |
commit | 46117ecdc9eedbf060f32b9e7fb53f509245332d (patch) | |
tree | abed15594dd10663de56deda0665f3f17140b407 /src/arch | |
parent | 4936474c2cb47528deaeb1b0e8ebca1ffb5b8426 (diff) | |
download | gem5-46117ecdc9eedbf060f32b9e7fb53f509245332d.tar.xz |
arch,sim: Use the guest ABI mechanism with pseudo instructions.
Right now, there are only two places which call the pseudoInst function
directly, the ARM KVM CPU and the generic mmapped IPR. These two
callers currently use the generic "PseudoInstABI" which is just a
wrapper around the existing getArgument function.
In the future, this getArgument function will be disolved, and the
PseudoInstABI will be defined for each ABI. Since it currently mimics
the Linux ABI since gem5 can only handle one ABI at a time right now,
this implementation will probably be shared by linux system calls,
except that the pseudo inst implementation will eat return values since
those are returned through other means when the pseudo inst is based on
magic address ranges.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187
Change-Id: Ied97e4a968795158873e492289a1058c8e4e411b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23178
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/kvm/arm_cpu.cc | 5 | ||||
-rw-r--r-- | src/arch/generic/mmapped_ipr.cc | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/arm/kvm/arm_cpu.cc b/src/arch/arm/kvm/arm_cpu.cc index 4d6b9a1b3..0a77ee0d6 100644 --- a/src/arch/arm/kvm/arm_cpu.cc +++ b/src/arch/arm/kvm/arm_cpu.cc @@ -320,8 +320,9 @@ ArmKvmCPU::onKvmExitHypercall() const uint8_t func((reg_ip >> 8) & 0xFF); const uint8_t subfunc(reg_ip & 0xFF); - DPRINTF(Kvm, "KVM Hypercall: 0x%x/0x%x\n", func, subfunc); - const uint64_t ret(PseudoInst::pseudoInst(getContext(0), func, subfunc)); + DPRINTF(Kvm, "KVM Hypercall: %#x/%#x\n", func, subfunc); + const uint64_t ret = + PseudoInst::pseudoInst<PseudoInstABI>(getContext(0), func, subfunc); // Just set the return value using the KVM API instead of messing // with the context. We could have used the context, but that diff --git a/src/arch/generic/mmapped_ipr.cc b/src/arch/generic/mmapped_ipr.cc index bf6bf99f4..8bdd18016 100644 --- a/src/arch/generic/mmapped_ipr.cc +++ b/src/arch/generic/mmapped_ipr.cc @@ -47,7 +47,7 @@ handlePseudoInst(ThreadContext *xc, Packet *pkt) uint64_t ret; assert((offset >> 16) == 0); - ret = PseudoInst::pseudoInst(xc, func, subfunc); + ret = PseudoInst::pseudoInst<PseudoInstABI>(xc, func, subfunc); if (pkt->isRead()) pkt->set(ret, TheISA::GuestByteOrder); } |