From: Gabe Black Date: Thu, 27 Feb 2020 00:57:54 +0000 (-0800) Subject: arm: Add a callSemihosting method that figures out the width. X-Git-Tag: v20.0.0.0~239 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b6fadd7d782c97d9c3a779de8bf37a47abcdf5d;p=gem5.git arm: Add a callSemihosting method that figures out the width. Change-Id: Ic94987fffd04648932e5dd085ffeef8500e335cf Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25951 Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com> Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini --- diff --git a/src/arch/arm/system.cc b/src/arch/arm/system.cc index 5d8808cba..5d261a790 100644 --- a/src/arch/arm/system.cc +++ b/src/arch/arm/system.cc @@ -191,6 +191,15 @@ ArmSystem::callSemihosting32(ThreadContext *tc, bool gem5_ops) return getArmSystem(tc)->semihosting->call32(tc, gem5_ops); } +bool +ArmSystem::callSemihosting(ThreadContext *tc, bool gem5_ops) +{ + if (ArmISA::inAArch64(tc)) + return callSemihosting64(tc, gem5_ops); + else + return callSemihosting32(tc, gem5_ops); +} + void ArmSystem::callSetStandByWfi(ThreadContext *tc) { diff --git a/src/arch/arm/system.hh b/src/arch/arm/system.hh index 370a3df33..364a80437 100644 --- a/src/arch/arm/system.hh +++ b/src/arch/arm/system.hh @@ -319,6 +319,9 @@ class ArmSystem : public System /** Make a Semihosting call from aarch32 */ static bool callSemihosting32(ThreadContext *tc, bool gem5_ops=false); + /** Make a Semihosting call from either aarch64 or aarch32 */ + static bool callSemihosting(ThreadContext *tc, bool gem5_ops=false); + /** Make a call to notify the power controller of STANDBYWFI assertion */ static void callSetStandByWfi(ThreadContext *tc);