From ba00d7449df87c99bf8aca97a877b493c14f4866 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 7 Nov 2016 18:16:51 +0000 Subject: 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 Reviewed-by: Nikos Nikoleris Reviewed-by: Sudhanshu Jha Reviewed-by: Rekai Gonzalez Alberquilla Reviewed-on: https://gem5-review.googlesource.com/2325 Reviewed-by: Weiping Liao Reviewed-by: Jason Lowe-Power --- src/dev/virtio/base.hh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/dev/virtio/base.hh') diff --git a/src/dev/virtio/base.hh b/src/dev/virtio/base.hh index 4d4c16536..89c281f21 100644 --- a/src/dev/virtio/base.hh +++ b/src/dev/virtio/base.hh @@ -1,5 +1,5 @@ /* - * 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 @@ -48,6 +48,8 @@ #include "sim/sim_object.hh" struct VirtIODeviceBaseParams; +struct VirtIODummyDeviceParams; + class VirtQueue; /** @{ @@ -875,4 +877,14 @@ class VirtIODeviceBase : public SimObject Callback *transKick; }; +class VirtIODummyDevice : public VirtIODeviceBase +{ + public: + VirtIODummyDevice(VirtIODummyDeviceParams *params); + + protected: + /** VirtIO device ID */ + static const DeviceId ID_INVALID = 0x00; +}; + #endif // __DEV_VIRTIO_BASE_HH__ -- cgit v1.2.3