1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

Kernel: Keep records of PCI::Address & PCI::ID pairs for enumeration

This commit is contained in:
Liav A 2020-04-10 20:25:03 +03:00 committed by Andreas Kling
parent 688dd9ea66
commit 65f939b55c
12 changed files with 49 additions and 13 deletions

View file

@ -157,7 +157,7 @@ u32 BXVGADevice::find_framebuffer_address()
static const PCI::ID bochs_vga_id = { 0x1234, 0x1111 };
static const PCI::ID virtualbox_vga_id = { 0x80ee, 0xbeef };
u32 framebuffer_address = 0;
PCI::enumerate_all([&framebuffer_address](const PCI::Address& address, PCI::ID id) {
PCI::enumerate([&framebuffer_address](const PCI::Address& address, PCI::ID id) {
if (id == bochs_vga_id || id == virtualbox_vga_id) {
framebuffer_address = PCI::get_BAR0(address) & 0xfffffff0;
klog() << "BXVGA: framebuffer @ " << PhysicalAddress(framebuffer_address);

View file

@ -118,7 +118,7 @@ static Lock& s_lock()
OwnPtr<PATAChannel> PATAChannel::create(ChannelType type, bool force_pio)
{
PCI::Address pci_address;
PCI::enumerate_all([&](const PCI::Address& address, PCI::ID id) {
PCI::enumerate([&](const PCI::Address& address, PCI::ID id) {
if (PCI::get_class(address) == PCI_Mass_Storage_Class && PCI::get_subclass(address) == PCI_IDE_Controller_Subclass) {
pci_address = address;
klog() << "PATAChannel: PATA Controller found, ID " << id;