summary refs log tree commit diff
path: root/aarch64/src
diff options
context:
space:
mode:
authorDaniel Prilik <prilik@google.com>2019-03-25 16:17:09 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-17 17:23:02 -0700
commit7303d2c491f9c679bcbc506100adef81baefe30c (patch)
tree924d8b8f06e3c5c556e69b8a63c8454fa63b47d9 /aarch64/src
parentfd8cad3fd2ddcc07163586a0aff13b81dc9f4999 (diff)
downloadcrosvm-7303d2c491f9c679bcbc506100adef81baefe30c.tar
crosvm-7303d2c491f9c679bcbc506100adef81baefe30c.tar.gz
crosvm-7303d2c491f9c679bcbc506100adef81baefe30c.tar.bz2
crosvm-7303d2c491f9c679bcbc506100adef81baefe30c.tar.lz
crosvm-7303d2c491f9c679bcbc506100adef81baefe30c.tar.xz
crosvm-7303d2c491f9c679bcbc506100adef81baefe30c.tar.zst
crosvm-7303d2c491f9c679bcbc506100adef81baefe30c.zip
resources: add build method to SystemAllocator
AddressRanges' name doesn't suggest that it's a SystemAllocator builder.
This CL renames it to SystemAllocatorBuilder, and adds a
SystemAllocator::builder() that removes the need to have a separate
import for the Builder.

A minor change, but it cleans up the interface a bit.

BUG=chromium:936567
TEST=cargo test -p resources && cargo build

Change-Id: I6d14368490c0d3c4018858f541e4ae5390995878
Reviewed-on: https://chromium-review.googlesource.com/1540398
Commit-Ready: Daniel Prilik <prilik@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'aarch64/src')
-rw-r--r--aarch64/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/aarch64/src/lib.rs b/aarch64/src/lib.rs
index 95e633f..39deca0 100644
--- a/aarch64/src/lib.rs
+++ b/aarch64/src/lib.rs
@@ -14,7 +14,7 @@ use arch::{RunnableLinuxVm, VmComponents};
 use devices::{Bus, BusError, PciConfigMmio, PciDevice, PciInterruptPin};
 use io_jail::Minijail;
 use remain::sorted;
-use resources::{AddressRanges, SystemAllocator};
+use resources::SystemAllocator;
 use sync::Mutex;
 use sys_util::{EventFd, GuestAddress, GuestMemory, GuestMemoryError};
 
@@ -344,7 +344,7 @@ impl AArch64 {
     /// Returns a system resource allocator.
     fn get_resource_allocator(mem_size: u64, gpu_allocation: bool) -> SystemAllocator {
         let device_addr_start = Self::get_base_dev_pfn(mem_size) * sys_util::pagesize() as u64;
-        AddressRanges::new()
+        SystemAllocator::builder()
             .add_device_addresses(device_addr_start, u64::max_value() - device_addr_start)
             .add_mmio_addresses(AARCH64_MMIO_BASE, AARCH64_MMIO_SIZE)
             .create_allocator(AARCH64_IRQ_BASE, gpu_allocation)