Skip to content

Commit 2511846

Browse files
committed
feat(pci): Allow mapping of 32-bit bars
Signed-off-by: Jens Reidel <[email protected]>
1 parent e3fda47 commit 2511846

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/drivers/pci.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<T: ConfigRegionAccess> PciDevice<T> {
137137
/// no_cache determines if we set the `Cache Disable` flag in the page-table-entry.
138138
/// Returns (virtual-pointer, size) if successful, else None (if bar non-existent or IOSpace)
139139
pub fn memory_map_bar(&self, index: u8, no_cache: bool) -> Option<(VirtAddr, usize)> {
140-
let (address, size, prefetchable, width) = match self.get_bar(index) {
140+
let (address, size, prefetchable, _width) = match self.get_bar(index) {
141141
Some(Bar::Io { .. }) => {
142142
warn!("Cannot map IOBar!");
143143
return None;
@@ -168,10 +168,6 @@ impl<T: ConfigRegionAccess> PciDevice<T> {
168168

169169
debug!("Mapping bar {index} at {address:#x} with length {size:#x}");
170170

171-
if width != 64 {
172-
warn!("Currently only mapping of 64 bit bars is supported!");
173-
return None;
174-
}
175171
if !prefetchable {
176172
warn!("Currently only mapping of prefetchable bars is supported!");
177173
}

0 commit comments

Comments
 (0)