From 185b1082fbf5381f431614ae6a5b30a83a924cd5 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 17 Jul 2019 12:13:20 -0700 Subject: [PATCH] pci: Add a helper to set the BAR type A BAR can be three different types: IO, 32 bits Memory, or 64 bits Memory. The VMM needs a way to set the right type depending on its needs. Signed-off-by: Sebastien Boeuf --- pci/src/configuration.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pci/src/configuration.rs b/pci/src/configuration.rs index 276accdbe..d0b14aea1 100755 --- a/pci/src/configuration.rs +++ b/pci/src/configuration.rs @@ -632,6 +632,11 @@ impl PciBarConfiguration { pub fn get_size(&self) -> u64 { self.size } + + pub fn set_region_type(mut self, region_type: PciBarRegionType) -> Self { + self.region_type = region_type; + self + } } #[cfg(test)]