diff options
author | Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> | 2019-10-30 14:59:26 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-10 06:39:34 +0000 |
commit | 383b3b520a76a921be17a12640b24fba1419dbbb (patch) | |
tree | 1aea1553c2534aab73b265929cf462c0d8999a67 /devices/src | |
parent | 87a3b44d9e6caa82ab521a5dd9bafdb56e8b6ed1 (diff) | |
download | crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.gz crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.bz2 crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.lz crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.xz crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.tar.zst crosvm-383b3b520a76a921be17a12640b24fba1419dbbb.zip |
resource: Rename device memory to mmio
Since unified allocator is used to allocate mmio, this patch remove the device memory name, and rename device to mmio. BUG=chromium:992270 TEST=this patch doesn't change function, run build_test Change-Id: I234b0db4b3c5de8cfee372ace5212a980564d0c7 Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1895234 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'devices/src')
-rw-r--r-- | devices/src/pci/ac97.rs | 8 | ||||
-rw-r--r-- | devices/src/pci/vfio_pci.rs | 2 | ||||
-rw-r--r-- | devices/src/usb/xhci/xhci_controller.rs | 2 | ||||
-rw-r--r-- | devices/src/virtio/virtio_pci_device.rs | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/devices/src/pci/ac97.rs b/devices/src/pci/ac97.rs index 73a5093..9a3c7e5 100644 --- a/devices/src/pci/ac97.rs +++ b/devices/src/pci/ac97.rs @@ -149,7 +149,7 @@ impl PciDevice for Ac97Dev { .expect("assign_bus_dev must be called prior to allocate_io_bars"); let mut ranges = Vec::new(); let mixer_regs_addr = resources - .mmio_allocator(MmioType::Mmio) + .mmio_allocator(MmioType::Low) .allocate_with_align( MIXER_REGS_SIZE, Alloc::PciBar { bus, dev, bar: 0 }, @@ -167,7 +167,7 @@ impl PciDevice for Ac97Dev { ranges.push((mixer_regs_addr, MIXER_REGS_SIZE)); let master_regs_addr = resources - .mmio_allocator(MmioType::Mmio) + .mmio_allocator(MmioType::Low) .allocate_with_align( MASTER_REGS_SIZE, Alloc::PciBar { bus, dev, bar: 1 }, @@ -245,8 +245,8 @@ mod tests { let mut ac97_dev = Ac97Dev::new(mem, Box::new(DummyStreamSource::new())); let mut allocator = SystemAllocator::builder() .add_io_addresses(0x1000_0000, 0x1000_0000) - .add_mmio_addresses(0x2000_0000, 0x1000_0000) - .add_device_addresses(0x3000_0000, 0x1000_0000) + .add_low_mmio_addresses(0x2000_0000, 0x1000_0000) + .add_high_mmio_addresses(0x3000_0000, 0x1000_0000) .create_allocator(5, false) .unwrap(); ac97_dev.assign_bus_dev(0, 0); diff --git a/devices/src/pci/vfio_pci.rs b/devices/src/pci/vfio_pci.rs index c10715d..2243990 100644 --- a/devices/src/pci/vfio_pci.rs +++ b/devices/src/pci/vfio_pci.rs @@ -502,7 +502,7 @@ impl PciDevice for VfioPciDevice { size |= u64::from(low); size = !size + 1; let bar_addr = resources - .mmio_allocator(MmioType::Mmio) + .mmio_allocator(MmioType::Low) .allocate_with_align( size, Alloc::PciBar { diff --git a/devices/src/usb/xhci/xhci_controller.rs b/devices/src/usb/xhci/xhci_controller.rs index dfba4a4..db06b6e 100644 --- a/devices/src/usb/xhci/xhci_controller.rs +++ b/devices/src/usb/xhci/xhci_controller.rs @@ -213,7 +213,7 @@ impl PciDevice for XhciController { .expect("assign_bus_dev must be called prior to allocate_io_bars"); // xHCI spec 5.2.1. let bar0_addr = resources - .mmio_allocator(MmioType::Mmio) + .mmio_allocator(MmioType::Low) .allocate_with_align( XHCI_BAR0_SIZE, Alloc::PciBar { bus, dev, bar: 0 }, diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs index bd94fe3..cbe56a2 100644 --- a/devices/src/virtio/virtio_pci_device.rs +++ b/devices/src/virtio/virtio_pci_device.rs @@ -384,7 +384,7 @@ impl PciDevice for VirtioPciDevice { // Allocate one bar for the structures pointed to by the capability structures. let mut ranges = Vec::new(); let settings_config_addr = resources - .mmio_allocator(MmioType::Mmio) + .mmio_allocator(MmioType::Low) .allocate_with_align( CAPABILITY_BAR_SIZE, Alloc::PciBar { bus, dev, bar: 0 }, @@ -422,7 +422,7 @@ impl PciDevice for VirtioPciDevice { let mut ranges = Vec::new(); for config in self.device.get_device_bars(bus, dev) { let device_addr = resources - .mmio_allocator(MmioType::Device) + .mmio_allocator(MmioType::High) .allocate_with_align( config.get_size(), Alloc::PciBar { |