Andreas Sandberg has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33296 )

Change subject: dev: Use the new ByteOrder param type in VirtIO devices
......................................................................

dev: Use the new ByteOrder param type in VirtIO devices

VirtIO devices currently request their endianness from the System
object. Instead of explicitly querying the system for its endianness,
expose the device's endianness as a param. This param defaults to the
endianness of a parent object using the Parent proxy (in practice the
system).

Change-Id: If4f84ff61f4d064bdd015a881790f5af03de6535
Signed-off-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/dev/virtio/VirtIO.py
M src/dev/virtio/base.cc
2 files changed, 2 insertions(+), 2 deletions(-)



diff --git a/src/dev/virtio/VirtIO.py b/src/dev/virtio/VirtIO.py
index bebacad..ed8cffa 100644
--- a/src/dev/virtio/VirtIO.py
+++ b/src/dev/virtio/VirtIO.py
@@ -50,6 +50,7 @@
     subsystem = Param.UInt8(0x00, "VirtIO subsystem ID")

     system = Param.System(Parent.any, "system object")
+    byte_order = Param.ByteOrder(Parent.byte_order, "Device byte order")

 class VirtIODummyDevice(VirtIODeviceBase):
     type = 'VirtIODummyDevice'
diff --git a/src/dev/virtio/base.cc b/src/dev/virtio/base.cc
index 6b4fe0a..f991625 100644
--- a/src/dev/virtio/base.cc
+++ b/src/dev/virtio/base.cc
@@ -40,7 +40,6 @@
 #include "debug/VIO.hh"
 #include "params/VirtIODeviceBase.hh"
 #include "params/VirtIODummyDevice.hh"
-#include "sim/system.hh"

 VirtDescriptor::VirtDescriptor(PortProxy &_memProxy, ByteOrder bo,
                                VirtQueue &_queue, Index descIndex)
@@ -326,7 +325,7 @@
size_t config_size, FeatureBits features)
     : SimObject(params),
       guestFeatures(0),
-      byteOrder(params->system->getGuestByteOrder()),
+      byteOrder(params->byte_order),
       deviceId(id), configSize(config_size), deviceFeatures(features),
       _deviceStatus(0), _queueSelect(0)
 {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33296
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If4f84ff61f4d064bdd015a881790f5af03de6535
Gerrit-Change-Number: 33296
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to