Remove physmap in pcid.
This commit is contained in:
@@ -27,3 +27,5 @@ smallvec = "1"
|
||||
structopt = { version = "0.3", default-features = false, features = [ "paw" ] }
|
||||
thiserror = "1"
|
||||
toml = "0.5"
|
||||
|
||||
common = { path = "../common" }
|
||||
|
||||
@@ -3,7 +3,6 @@ use std::collections::BTreeMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use syscall::PAGE_SIZE;
|
||||
use syscall::flag::PhysmapFlags;
|
||||
|
||||
use smallvec::SmallVec;
|
||||
|
||||
@@ -173,7 +172,14 @@ impl Pcie {
|
||||
};
|
||||
let mut maps_lock = self.maps.lock().unwrap();
|
||||
let virt_pointer = maps_lock.entry((bus, dev, func)).or_insert_with(|| {
|
||||
syscall::physmap(base_address_phys as usize + Self::addr_offset_in_bytes(starting_bus, bus, dev, func, 0), PAGE_SIZE, PhysmapFlags::PHYSMAP_NO_CACHE | PhysmapFlags::PHYSMAP_WRITE).unwrap_or_else(|error| panic!("failed to physmap pcie configuration space for {:2x}:{:2x}.{:2x}: {:?}", bus, dev, func, error)) as *mut u32
|
||||
common::physmap(
|
||||
base_address_phys as usize + Self::addr_offset_in_bytes(starting_bus, bus, dev, func, 0),
|
||||
PAGE_SIZE,
|
||||
common::Prot { read: true, write: true },
|
||||
common::MemoryType::Uncacheable,
|
||||
).unwrap_or_else(|error| {
|
||||
panic!("failed to physmap pcie configuration space for {:2x}:{:2x}.{:2x}: {:?}", bus, dev, func, error)
|
||||
}) as *mut u32
|
||||
});
|
||||
f(Some(&mut *virt_pointer.offset((offset as usize / mem::size_of::<u32>()) as isize)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user