allocator: Add a basic resource allocation crate

This is based on the crosvm resource allocator from commit 107edb3e.
We only have PIO and MMIO address space to handle, and don't have a GPU
specific path and space.
Also, we support allocating a range at a specified address. This is
mostly useful for PIO, but might be also necessary for MMIO.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-04-18 10:31:45 +02:00
parent 342bdc3619
commit db7937d47c
4 changed files with 421 additions and 0 deletions

9
vm-allocator/Cargo.toml Executable file
View File

@@ -0,0 +1,9 @@
[package]
name = "vm-allocator"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
[dependencies]
libc = "*"
vm-memory = { git = "https://github.com/rust-vmm/vm-memory" }