pci: Add minimal PCI host emulation crate

This crate is based on the crosvm devices/src/pci implementation from 107edb3e
We introduced a few changes:

- This one is a standalone crate. The device crate does not carry any
  PCI specific bits.
- Simplified PCI root configuration. We only carry a pointer to a
  PciConfiguration, not a wrapper around it.
- Simplified BAR allocation API. All BARs from the PciDevice instance
  must be generated at once through the PciDevice.allocate_bars()
  method.
- The PCI BARs are added to the MMIO bus from the PciRoot add_device()
  method.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-04-18 11:59:12 +02:00
parent fa3951df22
commit e8308dd13b
5 changed files with 1072 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
[package]
name = "pci"
version = "0.1.0"
authors = ["Samuel Ortiz <sameo@linux.intel.com>"]
edition = "2018"
[dependencies]
vm-allocator = { path = "../vm-allocator" }
byteorder = "*"
devices = { path = "../devices" }
kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls" }
kvm-bindings = "0.1"
libc = ">=0.2.39"
log = "*"
vm-memory = { git = "https://github.com/rust-vmm/vm-memory" }
vmm-sys-util = { git = "https://github.com/sameo/vmm-sys-util" }