diff options
author | Daniel Prilik <prilik@google.com> | 2019-03-25 16:17:09 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-17 17:23:02 -0700 |
commit | 7303d2c491f9c679bcbc506100adef81baefe30c (patch) | |
tree | 924d8b8f06e3c5c556e69b8a63c8454fa63b47d9 /x86_64 | |
parent | fd8cad3fd2ddcc07163586a0aff13b81dc9f4999 (diff) | |
download | crosvm-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 'x86_64')
-rw-r--r-- | x86_64/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index faba584..5229f63 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -67,7 +67,7 @@ use devices::{PciConfigIo, PciDevice, PciInterruptPin}; use io_jail::Minijail; use kvm::*; use remain::sorted; -use resources::{AddressRanges, SystemAllocator}; +use resources::SystemAllocator; use sync::Mutex; use sys_util::{Clock, EventFd, GuestAddress, GuestMemory, GuestMemoryError}; @@ -529,7 +529,7 @@ impl X8664arch { fn get_resource_allocator(mem_size: u64, gpu_allocation: bool) -> SystemAllocator { const MMIO_BASE: u64 = 0xe0000000; let device_addr_start = Self::get_base_dev_pfn(mem_size) * sys_util::pagesize() as u64; - AddressRanges::new() + 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) |