mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:37:45 +00:00
Kernel/VirtIO: Ignore Configurations that have length of zero bytes
These configurations are simply invalid. Ignoring those allow us to boot with the virtio-gpu-pci device (in addition to the already supported virtio-vga PCI device).
This commit is contained in:
parent
d4d49e00a2
commit
95b15e4901
1 changed files with 3 additions and 0 deletions
|
@ -113,6 +113,9 @@ UNMAP_AFTER_INIT void Device::initialize()
|
||||||
}
|
}
|
||||||
config.offset = capability.read32(0x8);
|
config.offset = capability.read32(0x8);
|
||||||
config.length = capability.read32(0xc);
|
config.length = capability.read32(0xc);
|
||||||
|
// NOTE: Configuration length of zero is an invalid configuration that should be ignored.
|
||||||
|
if (config.length == 0)
|
||||||
|
continue;
|
||||||
dbgln_if(VIRTIO_DEBUG, "{}: Found configuration {}, bar: {}, offset: {}, length: {}", m_class_name, (u32)config.cfg_type, config.bar, config.offset, config.length);
|
dbgln_if(VIRTIO_DEBUG, "{}: Found configuration {}, bar: {}, offset: {}, length: {}", m_class_name, (u32)config.cfg_type, config.bar, config.offset, config.length);
|
||||||
if (config.cfg_type == ConfigurationType::Common)
|
if (config.cfg_type == ConfigurationType::Common)
|
||||||
m_use_mmio = true;
|
m_use_mmio = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue