diff --git a/Kernel/Arch/x86_64/PCI/Controller/HostBridge.cpp b/Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.cpp similarity index 61% rename from Kernel/Arch/x86_64/PCI/Controller/HostBridge.cpp rename to Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.cpp index 67200fbea3c..da84509d4ed 100644 --- a/Kernel/Arch/x86_64/PCI/Controller/HostBridge.cpp +++ b/Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.cpp @@ -5,19 +5,19 @@ */ #include -#include +#include #include #include namespace Kernel::PCI { -NonnullOwnPtr HostBridge::must_create_with_io_access() +NonnullOwnPtr PIIX4HostBridge::must_create_with_io_access() { PCI::Domain domain { 0, 0, 0xff }; - return adopt_own_if_nonnull(new (nothrow) HostBridge(domain)).release_nonnull(); + return adopt_own_if_nonnull(new (nothrow) PIIX4HostBridge(domain)).release_nonnull(); } -HostBridge::HostBridge(PCI::Domain const& domain) +PIIX4HostBridge::PIIX4HostBridge(PCI::Domain const& domain) : HostController(domain) { } @@ -27,42 +27,42 @@ static u32 io_address_for_pci_field(BusNumber bus, DeviceNumber device, Function return 0x80000000u | (bus.value() << 16u) | (device.value() << 11u) | (function.value() << 8u) | (field & 0xfc); } -void HostBridge::write8_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u8 value) +void PIIX4HostBridge::write8_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u8 value) { VERIFY(m_access_lock.is_locked()); IO::out32(PCI::address_port, io_address_for_pci_field(bus, device, function, field)); IO::out8(PCI::value_port + (field & 3), value); } -void HostBridge::write16_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u16 value) +void PIIX4HostBridge::write16_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u16 value) { VERIFY(m_access_lock.is_locked()); IO::out32(PCI::address_port, io_address_for_pci_field(bus, device, function, field)); IO::out16(PCI::value_port + (field & 2), value); } -void HostBridge::write32_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u32 value) +void PIIX4HostBridge::write32_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field, u32 value) { VERIFY(m_access_lock.is_locked()); IO::out32(PCI::address_port, io_address_for_pci_field(bus, device, function, field)); IO::out32(PCI::value_port, value); } -u8 HostBridge::read8_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) +u8 PIIX4HostBridge::read8_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) { VERIFY(m_access_lock.is_locked()); IO::out32(PCI::address_port, io_address_for_pci_field(bus, device, function, field)); return IO::in8(PCI::value_port + (field & 3)); } -u16 HostBridge::read16_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) +u16 PIIX4HostBridge::read16_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) { VERIFY(m_access_lock.is_locked()); IO::out32(PCI::address_port, io_address_for_pci_field(bus, device, function, field)); return IO::in16(PCI::value_port + (field & 2)); } -u32 HostBridge::read32_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) +u32 PIIX4HostBridge::read32_field_locked(BusNumber bus, DeviceNumber device, FunctionNumber function, u32 field) { VERIFY(m_access_lock.is_locked()); IO::out32(PCI::address_port, io_address_for_pci_field(bus, device, function, field)); diff --git a/Kernel/Arch/x86_64/PCI/Controller/HostBridge.h b/Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.h similarity index 85% rename from Kernel/Arch/x86_64/PCI/Controller/HostBridge.h rename to Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.h index 59bcbb465c6..9f1986ce82f 100644 --- a/Kernel/Arch/x86_64/PCI/Controller/HostBridge.h +++ b/Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.h @@ -15,9 +15,9 @@ namespace Kernel::PCI { -class HostBridge : public HostController { +class PIIX4HostBridge : public HostController { public: - static NonnullOwnPtr must_create_with_io_access(); + static NonnullOwnPtr must_create_with_io_access(); private: virtual void write8_field_locked(BusNumber, DeviceNumber, FunctionNumber, u32 field, u8 value) override; @@ -28,7 +28,7 @@ private: virtual u16 read16_field_locked(BusNumber, DeviceNumber, FunctionNumber, u32 field) override; virtual u32 read32_field_locked(BusNumber, DeviceNumber, FunctionNumber, u32 field) override; - explicit HostBridge(PCI::Domain const&); + explicit PIIX4HostBridge(PCI::Domain const&); }; } diff --git a/Kernel/Bus/PCI/Access.cpp b/Kernel/Bus/PCI/Access.cpp index a911eaac99b..d2e24f78974 100644 --- a/Kernel/Bus/PCI/Access.cpp +++ b/Kernel/Bus/PCI/Access.cpp @@ -8,7 +8,7 @@ #include #include #if ARCH(X86_64) -# include +# include #endif #include #include @@ -114,7 +114,7 @@ UNMAP_AFTER_INIT bool Access::initialize_for_one_pci_domain() { VERIFY(!Access::is_initialized()); auto* access = new Access(); - auto host_bridge = HostBridge::must_create_with_io_access(); + auto host_bridge = PIIX4HostBridge::must_create_with_io_access(); access->add_host_controller(move(host_bridge)); access->rescan_hardware(); dbgln_if(PCI_DEBUG, "PCI: access for one PCI domain initialised."); diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 64e2514f62c..3e1b3596684 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -416,7 +416,7 @@ if ("${SERENITY_ARCH}" STREQUAL "x86_64") Arch/x86_64/ISABus/HID/VMWareMouseDevice.cpp Arch/x86_64/ISABus/I8042Controller.cpp Arch/x86_64/ISABus/SerialDevice.cpp - Arch/x86_64/PCI/Controller/HostBridge.cpp + Arch/x86_64/PCI/Controller/PIIX4HostBridge.cpp Arch/x86_64/PCI/Initializer.cpp Arch/x86_64/PCI/MSI.cpp diff --git a/Meta/gn/secondary/Kernel/BUILD.gn b/Meta/gn/secondary/Kernel/BUILD.gn index f0a402cb731..62194b08844 100644 --- a/Meta/gn/secondary/Kernel/BUILD.gn +++ b/Meta/gn/secondary/Kernel/BUILD.gn @@ -326,7 +326,7 @@ source_set("arch_sources") { "Arch/x86_64/Interrupts/APIC.cpp", "Arch/x86_64/Interrupts/IOAPIC.cpp", "Arch/x86_64/Interrupts/PIC.cpp", - "Arch/x86_64/PCI/Controller/HostBridge.cpp", + "Arch/x86_64/PCI/Controller/PIIX4HostBridge.cpp", "Arch/x86_64/PCI/Initializer.cpp", "Arch/x86_64/PCI/MSI.cpp", "Arch/x86_64/PCSpeaker.cpp",