Kernel: Detect devices when enumerating the PCI bus

Instead of making each driver to enumerate the PCI bus itself,
PCI::Initializer will call detect_devices() to do one enumeration
of the bus.
This commit is contained in:
Liav A 2020-02-02 01:52:51 +02:00 committed by Andreas Kling
commit 583e9ad372
Notes: sideshowbarker 2024-07-19 09:42:51 +09:00
10 changed files with 64 additions and 50 deletions

View file

@ -74,6 +74,10 @@ struct ID {
{
return vendor_id == other.vendor_id && device_id == other.device_id;
}
bool operator!=(const ID& other) const
{
return vendor_id != other.vendor_id || device_id != other.device_id;
}
};
struct Address {
@ -156,6 +160,7 @@ struct ChangeableAddress : public Address {
}
};
ID get_id(PCI::Address);
void enumerate_all(Function<void(Address, ID)> callback);
u8 get_interrupt_line(Address);
u32 get_BAR0(Address);