summary refs log tree commit diff
path: root/src/linux.rs
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2018-05-23 17:57:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-07-18 21:59:01 -0700
commit836466aeaddf348b2c7721b3fa56b5c5628d400a (patch)
tree581f05e428ee1a927f176e8e084c048442f803b1 /src/linux.rs
parent898921fe78d1809c1d35ab9e03e384232745410d (diff)
downloadcrosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar
crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.gz
crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.bz2
crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.lz
crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.xz
crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.tar.zst
crosvm-836466aeaddf348b2c7721b3fa56b5c5628d400a.zip
devices: proxy - Add support for proxying PciDevices
PCI adds a configuration space to the existing memory mapped IO
supported by BusDevices.

Add the ability to set configuration space as optional to the BusDevice
trait so that ProxyDevice can be shared.

PCI devices can have more than one memory mapped region. Expand the bus
so that it has the ability to pass an absolute address instead of an
offset. This will allow the PCI device to know which BAR is being
written to.

Change-Id: I055cd516c49a74316a9547df471290f05d865b0a
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1103663
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Diffstat (limited to 'src/linux.rs')
-rw-r--r--src/linux.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/linux.rs b/src/linux.rs
index 1c524db..80c1b0f 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -320,13 +320,15 @@ fn register_mmio(bus: &mut devices::Bus,
         bus
             .insert(Arc::new(Mutex::new(proxy_dev)),
             mmio_base,
-            mmio_len)
+            mmio_len,
+            false)
             .unwrap();
     } else {
         bus
             .insert(Arc::new(Mutex::new(mmio_device)),
             mmio_base,
-            mmio_len)
+            mmio_len,
+            false)
             .unwrap();
     }