summaryrefslogtreecommitdiff
path: root/src/dev/virtio/VirtIO.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-11-07 18:16:51 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-04-03 16:36:15 +0000
commitba00d7449df87c99bf8aca97a877b493c14f4866 (patch)
treeaf6e8b32972ddfe6a874b0b9e9ffaf90aded973d /src/dev/virtio/VirtIO.py
parentcd9ca71b25e0b119c04eb87d4d1d74cfc90587e9 (diff)
downloadgem5-ba00d7449df87c99bf8aca97a877b493c14f4866.tar.xz
dev: Add a dummy VirtIO device
VirtIO transport interfaces always expect a VirtIO device pointer. However, there are cases (in particular when using VirtIO's MMIO interface) where we want to instantiate an interface without a device. Add a dummy device using VirtIO device ID 0 and no queues to handle this use case. Change-Id: I6cbe12fd403903ef585be40279c3b1321fde48ff Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Sudhanshu Jha <sudhanshu.jha@arm.com> Reviewed-by: Rekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2325 Reviewed-by: Weiping Liao <weipingliao@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/dev/virtio/VirtIO.py')
-rw-r--r--src/dev/virtio/VirtIO.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dev/virtio/VirtIO.py b/src/dev/virtio/VirtIO.py
index 1345c7603..bf050fd47 100644
--- a/src/dev/virtio/VirtIO.py
+++ b/src/dev/virtio/VirtIO.py
@@ -1,6 +1,6 @@
# -*- mode:python -*-
-# Copyright (c) 2014 ARM Limited
+# Copyright (c) 2014, 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -53,11 +53,15 @@ class VirtIODeviceBase(SimObject):
system = Param.System(Parent.any, "system object")
+class VirtIODummyDevice(VirtIODeviceBase):
+ type = 'VirtIODummyDevice'
+ cxx_header = 'dev/virtio/base.hh'
+
class PciVirtIO(PciDevice):
type = 'PciVirtIO'
cxx_header = 'dev/virtio/pci.hh'
- vio = Param.VirtIODeviceBase("VirtIO device")
+ vio = Param.VirtIODeviceBase(VirtIODummyDevice(), "VirtIO device")
VendorID = 0x1AF4
SubsystemVendorID = VendorID;