arch-arm: Hint the compiler to inline getArmSystem
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 5 Mar 2020 13:29:49 +0000 (13:29 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 10 Mar 2020 11:24:13 +0000 (11:24 +0000)
By defining it in the header we are hinting the compiler to inline
the method

Change-Id: I132964bf8b8c0b5d5eb28868f15723177d049d38
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26323
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
src/arch/arm/system.cc
src/arch/arm/system.hh

index f9bfdec929c63e3fbce811096a3454ee3ee8888e..56ee98ded67a0ca9018e7298202ce7dd95dd09b8 100644 (file)
@@ -50,7 +50,6 @@
 #include "dev/arm/gic_v2.hh"
 #include "mem/fs_translating_port_proxy.hh"
 #include "mem/physical.hh"
-#include "sim/full_system.hh"
 
 using namespace std;
 using namespace Linux;
@@ -180,13 +179,6 @@ ArmSystem::initState()
     }
 }
 
-ArmSystem*
-ArmSystem::getArmSystem(ThreadContext *tc)
-{
-    assert(FullSystem);
-    return static_cast<ArmSystem *>(tc->getSystemPtr());
-}
-
 bool
 ArmSystem::haveSecurity(ThreadContext *tc)
 {
index 26b417ed78f7c855c78cdc8dcae93e903c6b8b6b..6331af283bd64b51f40a54ecf912b2c79f6d8a6b 100644 (file)
@@ -48,6 +48,7 @@
 #include "kern/linux/events.hh"
 #include "params/ArmSystem.hh"
 #include "params/GenericArmSystem.hh"
+#include "sim/full_system.hh"
 #include "sim/sim_object.hh"
 #include "sim/system.hh"
 
@@ -274,7 +275,12 @@ class ArmSystem : public System
      * Returns a valid ArmSystem pointer if using ARM ISA, it fails
      * otherwise.
      */
-    static ArmSystem* getArmSystem(ThreadContext *tc);
+    static ArmSystem*
+    getArmSystem(ThreadContext *tc)
+    {
+        assert(FullSystem);
+        return static_cast<ArmSystem *>(tc->getSystemPtr());
+    }
 
     /** Returns true if the system of a specific thread context implements the
      * Security Extensions