sim: Add a getGuestByteOrder accessor to the system class.
authorGabe Black <gabeblack@google.com>
Tue, 29 Oct 2019 03:58:14 +0000 (20:58 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 30 Oct 2019 22:29:23 +0000 (22:29 +0000)
This goes along with the existing getPageBytes, etc., accessors, and
paves the way for this to be a parameter of the System class.

Change-Id: Ibfe2d591185d23beccdd5bbff1092dc07b1278ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22272
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/system.hh

index d205ffb7ac0b2e6835a9b10f0f42ea04358e0332..338b12619310655014acc0a560b653097e686e21 100644 (file)
@@ -283,6 +283,19 @@ class System : public SimObject, public PCEventScope
      */
     Arch getArch() const { return Arch::TheISA; }
 
+    /**
+     * Get the guest byte order.
+     */
+    ByteOrder
+    getGuestByteOrder() const
+    {
+#if THE_ISA != NULL_ISA
+        return TheISA::GuestByteOrder;
+#else
+        panic("The NULL ISA has no endianness.");
+#endif
+    }
+
      /**
      * Get the page bytes for the ISA.
      */