arch: Get the byte order from sys and not TheISA::.
authorGabe Black <gabeblack@google.com>
Wed, 19 Aug 2020 08:52:28 +0000 (01:52 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 20 Aug 2020 04:45:35 +0000 (04:45 +0000)
This is a small step which localizes the use of TheISA, hopefully making
it easier to eliminate in the future.

Change-Id: I13472ed69e12a3c753e2dea91b9c7ca813bfc0e7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32919
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/generic/linux/threadinfo.hh

index 8e039ae2eed4bfd480e0e958cf307f38ffba73c5..73c8173e6c9a3ccbb0dddf75d7b7b6298d5682e4 100644 (file)
@@ -41,6 +41,8 @@ class ThreadInfo
     System *sys;
     Addr pcbb;
 
+    ByteOrder byteOrder;
+
     template <typename T>
     bool
     get_data(const char *symbol, T &data)
@@ -54,14 +56,15 @@ class ThreadInfo
             return false;
         }
 
-        data = tc->getVirtProxy().read<T>(it->address, TheISA::GuestByteOrder);
+        data = tc->getVirtProxy().read<T>(it->address, byteOrder);
 
         return true;
     }
 
   public:
     ThreadInfo(ThreadContext *_tc, Addr _pcbb = 0)
-        : tc(_tc), sys(tc->getSystemPtr()), pcbb(_pcbb)
+        : tc(_tc), sys(tc->getSystemPtr()), pcbb(_pcbb),
+        byteOrder(tc->getSystemPtr()->getGuestByteOrder())
     {
 
     }