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 /x86_64/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 'x86_64/src')
-rw-r--r-- | x86_64/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index c15221e..1974ce2 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -578,12 +578,12 @@ impl X8664arch { Ok(None) } - /// This returns the start address of device memory + /// This returns the start address of high mmio /// /// # Arguments /// /// * mem: The memory to be used by the guest - fn get_dev_memory_base(mem: &GuestMemory) -> u64 { + fn get_high_mmio_base(mem: &GuestMemory) -> u64 { // Put device memory at a 2MB boundary after physical memory or 4gb, whichever is greater. const MB: u64 = 1 << 20; const GB: u64 = 1 << 30; @@ -605,12 +605,12 @@ impl X8664arch { /// Returns a system resource allocator. fn get_resource_allocator(mem: &GuestMemory, gpu_allocation: bool) -> SystemAllocator { - const MMIO_BASE: u64 = 0xe0000000; - let device_addr_start = Self::get_dev_memory_base(mem); + const LOW_MMIO_BASE: u64 = 0xe0000000; + let high_mmio_start = Self::get_high_mmio_base(mem); SystemAllocator::builder() .add_io_addresses(0xc000, 0x10000) - .add_mmio_addresses(MMIO_BASE, 0x100000) - .add_device_addresses(device_addr_start, u64::max_value() - device_addr_start) + .add_low_mmio_addresses(LOW_MMIO_BASE, 0x100000) + .add_high_mmio_addresses(high_mmio_start, u64::max_value() - high_mmio_start) .create_allocator(X86_64_IRQ_BASE, gpu_allocation) .unwrap() } |