mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
Kernel/x86_64: Rename PCI HostBridge => PIIX4HostBridge
This code is actually for the old PIIX4 PCI host bridge, which requires to use legacy x86 IO instructions.
This commit is contained in:
parent
69a3602237
commit
e1d435d0b0
5 changed files with 17 additions and 17 deletions
|
@ -5,19 +5,19 @@
|
|||
*/
|
||||
|
||||
#include <Kernel/Arch/x86_64/IO.h>
|
||||
#include <Kernel/Arch/x86_64/PCI/Controller/HostBridge.h>
|
||||
#include <Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Sections.h>
|
||||
|
||||
namespace Kernel::PCI {
|
||||
|
||||
NonnullOwnPtr<HostBridge> HostBridge::must_create_with_io_access()
|
||||
NonnullOwnPtr<PIIX4HostBridge> 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));
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
namespace Kernel::PCI {
|
||||
|
||||
class HostBridge : public HostController {
|
||||
class PIIX4HostBridge : public HostController {
|
||||
public:
|
||||
static NonnullOwnPtr<HostBridge> must_create_with_io_access();
|
||||
static NonnullOwnPtr<PIIX4HostBridge> 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&);
|
||||
};
|
||||
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
#include <AK/Error.h>
|
||||
#include <AK/HashTable.h>
|
||||
#if ARCH(X86_64)
|
||||
# include <Kernel/Arch/x86_64/PCI/Controller/HostBridge.h>
|
||||
# include <Kernel/Arch/x86_64/PCI/Controller/PIIX4HostBridge.h>
|
||||
#endif
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/Controller/MemoryBackedHostBridge.h>
|
||||
|
@ -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.");
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue