From cbf20899528f523db38b78c32d27dcb8fc8485fd Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 28 Oct 2019 20:58:14 -0700 Subject: [PATCH] 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 --- src/sim/system.hh | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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. */ -- 2.30.2