Kernel/PCI: Expose PCI option ROM data from the sysfs interface

For each exposed PCI device in sysfs, there's a new node called "rom"
and by reading it, it exposes the raw data of a PCI option ROM blob to
a user for examining the blob.
This commit is contained in:
Liav A 2022-02-10 20:35:30 +02:00 committed by Jelle Raaijmakers
commit a7677f1d9b
Notes: sideshowbarker 2024-07-18 08:59:31 +09:00
6 changed files with 155 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include <Kernel/Bus/PCI/Access.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceAttribute.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceDirectory.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceExpansionROM.h>
#include <Kernel/Sections.h>
namespace Kernel {
@ -34,6 +35,7 @@ UNMAP_AFTER_INIT NonnullLockRefPtr<PCIDeviceSysFSDirectory> PCIDeviceSysFSDirect
list.append(PCIDeviceAttributeSysFSComponent::create(*directory, PCI::RegisterOffset::BAR3, 4));
list.append(PCIDeviceAttributeSysFSComponent::create(*directory, PCI::RegisterOffset::BAR4, 4));
list.append(PCIDeviceAttributeSysFSComponent::create(*directory, PCI::RegisterOffset::BAR5, 4));
list.append(PCIDeviceExpansionROMSysFSComponent::create(*directory));
return {};
}));
return directory;