1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:17:45 +00:00

Kernel/PCI: Don't create /proc/pci if PCI is disabled

Reading from /proc/pci assumes we have PCI enabled and also enumerated.
However, if PCI is disabled for some reason, we can't allow the user to
read from it as there's no valuable data we can supply.
This commit is contained in:
Liav A 2022-01-21 18:09:21 +02:00 committed by Andreas Kling
parent 2272d93215
commit b849e4f907
3 changed files with 15 additions and 1 deletions

View file

@ -138,12 +138,18 @@ protected:
mutable Mutex m_lock { "ProcFSLink" };
};
namespace PCI {
class Access;
}
class ProcFSRootDirectory final : public ProcFSExposedDirectory {
friend class ProcFSComponentRegistry;
public:
virtual ErrorOr<NonnullRefPtr<ProcFSExposedComponent>> lookup(StringView name) override;
static NonnullRefPtr<ProcFSRootDirectory> must_create();
void add_pci_node(Badge<PCI::Access>);
virtual ~ProcFSRootDirectory();
private: