diff --git a/local/recipes/drivers/redox-driver-pci/source/src/bus.rs b/local/recipes/drivers/redox-driver-pci/source/src/bus.rs index 77b788fa66..ff3d184436 100644 --- a/local/recipes/drivers/redox-driver-pci/source/src/bus.rs +++ b/local/recipes/drivers/redox-driver-pci/source/src/bus.rs @@ -50,8 +50,20 @@ impl Bus for PciBus { } let config_path = path.join("config"); - let config_data = match fs::read(&config_path) { - Ok(d) => d, + // Read only the 64-byte standard header: everything PciBus + // consumes (vendor/device at 0x00, class block at 0x08-0x0B, + // subsystem IDs at 0x2C-0x2F) lives there, and larger reads + // cross into PCIe extended space which does not exist on + // MCFG-less (PCI 3.0 I/O-port fallback) machines. + let config_data = match std::fs::File::open(&config_path) { + Ok(file) => { + use std::io::Read; + let mut buf = Vec::new(); + match file.take(64).read_to_end(&mut buf) { + Ok(_) => buf, + Err(_) => continue, + } + } Err(_) => continue, }; diff --git a/local/sources/base b/local/sources/base index c72d4247a6..b0e760659c 160000 --- a/local/sources/base +++ b/local/sources/base @@ -1 +1 @@ -Subproject commit c72d4247a66a764b0f06fe62d661ced415538ae2 +Subproject commit b0e760659c4c951381e8916dc64dca8a53af584f