arm: Add a callSemihosting method that figures out the width.
authorGabe Black <gabeblack@google.com>
Thu, 27 Feb 2020 00:57:54 +0000 (16:57 -0800)
committerGabe Black <gabeblack@google.com>
Fri, 27 Mar 2020 23:52:37 +0000 (23:52 +0000)
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 <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

src/arch/arm/system.cc
src/arch/arm/system.hh

index 5d8808cba1f08921088e1562c79ce7ea131a413a..5d261a7907ee7eefcb961d3ec40b280d3b822c8d 100644 (file)
@@ -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)
 {
index 370a3df3370a7aace80671ef2233b7a44460c242..364a804373c05eaeafd2221bf2fcba865def73c9 100644 (file)
@@ -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);