From: Gabe Black Date: Tue, 29 Oct 2019 03:58:14 +0000 (-0700) Subject: sim: Add a getGuestByteOrder accessor to the system class. X-Git-Tag: v19.0.0.0~360 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbf20899528f523db38b78c32d27dcb8fc8485fd;p=gem5.git sim: Add a getGuestByteOrder accessor to the system class. 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 Maintainer: Andreas Sandberg Tested-by: kokoro --- diff --git a/src/sim/system.hh b/src/sim/system.hh index d205ffb7a..338b12619 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -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. */