mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
Kernel: Rename PCI::DeviceController => PCI::Device
Now that the old PCI::Device was removed, we can complete the PCI changes by making the PCI::DeviceController to be named PCI::Device. Really the entire purpose and the distinction between the two was about interrupts, but since this is no longer a problem, just rename it to simplify things further.
This commit is contained in:
parent
7b9c3439ec
commit
aacb1f0bf4
30 changed files with 50 additions and 54 deletions
|
@ -255,8 +255,7 @@ class MMIOAccess;
|
|||
class WindowedMMIOAccess;
|
||||
class IOAccess;
|
||||
class MMIOSegment;
|
||||
class DeviceController;
|
||||
|
||||
class Device;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
|
||||
namespace Kernel {
|
||||
namespace PCI {
|
||||
|
||||
DeviceController::DeviceController(Address address)
|
||||
Device::Device(Address address)
|
||||
: m_pci_address(address)
|
||||
{
|
||||
}
|
||||
|
||||
bool DeviceController::is_msi_capable() const
|
||||
bool Device::is_msi_capable() const
|
||||
{
|
||||
for (const auto& capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
||||
if (capability.id() == PCI_CAPABILITY_MSI)
|
||||
|
@ -22,7 +22,7 @@ bool DeviceController::is_msi_capable() const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
bool DeviceController::is_msix_capable() const
|
||||
bool Device::is_msix_capable() const
|
||||
{
|
||||
for (const auto& capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
||||
if (capability.id() == PCI_CAPABILITY_MSIX)
|
||||
|
@ -31,28 +31,28 @@ bool DeviceController::is_msix_capable() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void DeviceController::enable_pin_based_interrupts() const
|
||||
void Device::enable_pin_based_interrupts() const
|
||||
{
|
||||
PCI::enable_interrupt_line(pci_address());
|
||||
}
|
||||
void DeviceController::disable_pin_based_interrupts() const
|
||||
void Device::disable_pin_based_interrupts() const
|
||||
{
|
||||
PCI::disable_interrupt_line(pci_address());
|
||||
}
|
||||
|
||||
void DeviceController::enable_message_signalled_interrupts()
|
||||
void Device::enable_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
void DeviceController::disable_message_signalled_interrupts()
|
||||
void Device::disable_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
void DeviceController::enable_extended_message_signalled_interrupts()
|
||||
void Device::enable_extended_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
||||
void DeviceController::disable_extended_message_signalled_interrupts()
|
||||
void Device::disable_extended_message_signalled_interrupts()
|
||||
{
|
||||
TODO();
|
||||
}
|
|
@ -10,11 +10,11 @@
|
|||
#include <Kernel/Bus/PCI/Definitions.h>
|
||||
|
||||
namespace Kernel {
|
||||
class PCI::DeviceController {
|
||||
class PCI::Device {
|
||||
public:
|
||||
Address pci_address() const { return m_pci_address; };
|
||||
|
||||
virtual ~DeviceController() = default;
|
||||
virtual ~Device() = default;
|
||||
void enable_pin_based_interrupts() const;
|
||||
void disable_pin_based_interrupts() const;
|
||||
|
||||
|
@ -28,7 +28,7 @@ public:
|
|||
void disable_extended_message_signalled_interrupts();
|
||||
|
||||
protected:
|
||||
explicit DeviceController(Address pci_address);
|
||||
explicit Device(Address pci_address);
|
||||
|
||||
private:
|
||||
Address m_pci_address;
|
|
@ -92,7 +92,7 @@ KResult UHCIController::initialize()
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT UHCIController::UHCIController(PCI::Address address)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, IRQHandler(PCI::get_interrupt_line(address))
|
||||
, m_io_base(PCI::get_BAR4(pci_address()) & ~1)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <AK/Platform.h>
|
||||
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Bus/USB/UHCI/UHCIDescriptorPool.h>
|
||||
#include <Kernel/Bus/USB/UHCI/UHCIDescriptorTypes.h>
|
||||
#include <Kernel/Bus/USB/UHCI/UHCIRootHub.h>
|
||||
|
@ -25,7 +25,7 @@ namespace Kernel::USB {
|
|||
|
||||
class UHCIController final
|
||||
: public USBController
|
||||
, public PCI::DeviceController
|
||||
, public PCI::Device
|
||||
, public IRQHandler {
|
||||
|
||||
static constexpr u8 MAXIMUM_NUMBER_OF_TDS = 128; // Upper pool limit. This consumes the second page we have allocated
|
||||
|
|
|
@ -44,7 +44,7 @@ UNMAP_AFTER_INIT void VirtIO::detect()
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT VirtIODevice::VirtIODevice(PCI::Address address, String class_name)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, IRQHandler(PCI::get_interrupt_line(address))
|
||||
, m_class_name(move(class_name))
|
||||
, m_io_base(IOAddress(PCI::get_BAR0(pci_address()) & ~1))
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Bus/VirtIO/VirtIOQueue.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
|
@ -85,7 +85,7 @@ public:
|
|||
};
|
||||
|
||||
class VirtIODevice
|
||||
: public PCI::DeviceController
|
||||
: public PCI::Device
|
||||
, public IRQHandler {
|
||||
public:
|
||||
virtual ~VirtIODevice() override;
|
||||
|
|
|
@ -25,7 +25,7 @@ set(KERNEL_SOURCES
|
|||
Arch/PC/BIOS.cpp
|
||||
Arch/x86/SmapDisabler.h
|
||||
Bus/PCI/Access.cpp
|
||||
Bus/PCI/DeviceController.cpp
|
||||
Bus/PCI/Device.cpp
|
||||
Bus/PCI/IOAccess.cpp
|
||||
Bus/PCI/MMIOAccess.cpp
|
||||
Bus/PCI/Initializer.cpp
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Bus/PCI/IDs.h>
|
||||
#include <Kernel/Devices/CharacterDevice.h>
|
||||
#include <Kernel/Devices/SerialDevice.h>
|
||||
|
|
|
@ -63,7 +63,7 @@ UNMAP_AFTER_INIT NonnullRefPtr<BochsGraphicsAdapter> BochsGraphicsAdapter::initi
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT BochsGraphicsAdapter::BochsGraphicsAdapter(PCI::Address pci_address)
|
||||
: PCI::DeviceController(pci_address)
|
||||
: PCI::Device(pci_address)
|
||||
, m_mmio_registers(PCI::get_BAR2(pci_address) & 0xfffffff0)
|
||||
, m_registers(Memory::map_typed_writable<BochsDisplayMMIORegisters volatile>(m_mmio_registers))
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Graphics/Console/GenericFramebufferConsole.h>
|
||||
#include <Kernel/Graphics/FramebufferDevice.h>
|
||||
#include <Kernel/Graphics/GraphicsDevice.h>
|
||||
|
@ -21,7 +21,7 @@ class GraphicsManagement;
|
|||
struct BochsDisplayMMIORegisters;
|
||||
|
||||
class BochsGraphicsAdapter final : public GraphicsDevice
|
||||
, public PCI::DeviceController {
|
||||
, public PCI::Device {
|
||||
AK_MAKE_ETERNAL
|
||||
friend class GraphicsManagement;
|
||||
|
||||
|
@ -64,5 +64,4 @@ private:
|
|||
bool m_console_enabled { false };
|
||||
bool m_io_required { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Graphics/Definitions.h>
|
||||
#include <Kernel/Graphics/FramebufferDevice.h>
|
||||
#include <Kernel/Graphics/VGACompatibleAdapter.h>
|
||||
|
|
|
@ -38,7 +38,7 @@ UNMAP_AFTER_INIT void VGACompatibleAdapter::initialize_framebuffer_devices()
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT VGACompatibleAdapter::VGACompatibleAdapter(PCI::Address address)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
{
|
||||
m_framebuffer_console = Graphics::TextModeConsole::initialize(*this);
|
||||
// FIXME: This is a very wrong way to do this...
|
||||
|
@ -46,7 +46,7 @@ UNMAP_AFTER_INIT VGACompatibleAdapter::VGACompatibleAdapter(PCI::Address address
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT VGACompatibleAdapter::VGACompatibleAdapter(PCI::Address address, PhysicalAddress framebuffer_address, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, m_framebuffer_address(framebuffer_address)
|
||||
, m_framebuffer_width(framebuffer_width)
|
||||
, m_framebuffer_height(framebuffer_height)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Graphics/Console/Console.h>
|
||||
#include <Kernel/Graphics/FramebufferDevice.h>
|
||||
#include <Kernel/Graphics/GraphicsDevice.h>
|
||||
|
@ -17,7 +17,7 @@
|
|||
namespace Kernel {
|
||||
|
||||
class VGACompatibleAdapter : public GraphicsDevice
|
||||
, public PCI::DeviceController {
|
||||
, public PCI::Device {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
static NonnullRefPtr<VGACompatibleAdapter> initialize_with_preset_resolution(PCI::Address, PhysicalAddress, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch);
|
||||
|
@ -53,5 +53,4 @@ protected:
|
|||
RefPtr<FramebufferDevice> m_framebuffer_device;
|
||||
RefPtr<Graphics::Console> m_framebuffer_console;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ NonnullRefPtr<GraphicsAdapter> GraphicsAdapter::initialize(PCI::Address base_add
|
|||
}
|
||||
|
||||
GraphicsAdapter::GraphicsAdapter(PCI::Address base_address)
|
||||
: PCI::DeviceController(base_address)
|
||||
: PCI::Device(base_address)
|
||||
{
|
||||
m_gpu_device = adopt_ref(*new GPU(base_address)).leak_ref();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Kernel::Graphics::VirtIOGPU {
|
|||
|
||||
class GraphicsAdapter final
|
||||
: public GraphicsDevice
|
||||
, public PCI::DeviceController {
|
||||
, public PCI::Device {
|
||||
AK_MAKE_ETERNAL
|
||||
|
||||
public:
|
||||
|
@ -40,5 +40,4 @@ private:
|
|||
RefPtr<GPU> m_gpu_device;
|
||||
bool m_created_framebuffer_devices { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Net/E1000NetworkAdapter.h>
|
||||
|
|
|
@ -220,7 +220,7 @@ UNMAP_AFTER_INIT bool E1000NetworkAdapter::initialize()
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, IRQHandler(irq)
|
||||
, m_rx_descriptors_region(MM.allocate_contiguous_kernel_region(Memory::page_round_up(sizeof(e1000_rx_desc) * number_of_rx_descriptors + 16), "E1000 RX Descriptors", Memory::Region::Access::ReadWrite))
|
||||
, m_tx_descriptors_region(MM.allocate_contiguous_kernel_region(Memory::page_round_up(sizeof(e1000_tx_desc) * number_of_tx_descriptors + 16), "E1000 TX Descriptors", Memory::Region::Access::ReadWrite))
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
|
@ -17,7 +17,7 @@
|
|||
namespace Kernel {
|
||||
|
||||
class E1000NetworkAdapter : public NetworkAdapter
|
||||
, public PCI::DeviceController
|
||||
, public PCI::Device
|
||||
, public IRQHandler {
|
||||
public:
|
||||
static RefPtr<E1000NetworkAdapter> try_to_initialize(PCI::Address);
|
||||
|
|
|
@ -161,7 +161,7 @@ UNMAP_AFTER_INIT RefPtr<NE2000NetworkAdapter> NE2000NetworkAdapter::try_to_initi
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT NE2000NetworkAdapter::NE2000NetworkAdapter(PCI::Address address, u8 irq)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, IRQHandler(irq)
|
||||
, m_io_base(PCI::get_BAR0(pci_address()) & ~3)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
|
@ -17,7 +17,7 @@
|
|||
namespace Kernel {
|
||||
|
||||
class NE2000NetworkAdapter final : public NetworkAdapter
|
||||
, public PCI::DeviceController
|
||||
, public PCI::Device
|
||||
, public IRQHandler {
|
||||
public:
|
||||
static RefPtr<NE2000NetworkAdapter> try_to_initialize(PCI::Address);
|
||||
|
|
|
@ -122,7 +122,7 @@ UNMAP_AFTER_INIT RefPtr<RTL8139NetworkAdapter> RTL8139NetworkAdapter::try_to_ini
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address address, u8 irq)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, IRQHandler(irq)
|
||||
, m_io_base(PCI::get_BAR0(pci_address()) & ~1)
|
||||
, m_rx_buffer(MM.allocate_contiguous_kernel_region(Memory::page_round_up(RX_BUFFER_SIZE + PACKET_SIZE_MAX), "RTL8139 RX", Memory::Region::Access::ReadWrite))
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
|
@ -19,7 +19,7 @@ namespace Kernel {
|
|||
#define RTL8139_TX_BUFFER_COUNT 4
|
||||
|
||||
class RTL8139NetworkAdapter final : public NetworkAdapter
|
||||
, public PCI::DeviceController
|
||||
, public PCI::Device
|
||||
, public IRQHandler {
|
||||
public:
|
||||
static RefPtr<RTL8139NetworkAdapter> try_to_initialize(PCI::Address);
|
||||
|
|
|
@ -192,7 +192,7 @@ UNMAP_AFTER_INIT RefPtr<RTL8168NetworkAdapter> RTL8168NetworkAdapter::try_to_ini
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT RTL8168NetworkAdapter::RTL8168NetworkAdapter(PCI::Address address, u8 irq)
|
||||
: PCI::DeviceController(address)
|
||||
: PCI::Device(address)
|
||||
, IRQHandler(irq)
|
||||
, m_io_base(PCI::get_BAR0(pci_address()) & ~1)
|
||||
, m_rx_descriptors_region(MM.allocate_contiguous_kernel_region(Memory::page_round_up(sizeof(TXDescriptor) * (number_of_rx_descriptors + 1)), "RTL8168 RX", Memory::Region::Access::ReadWrite))
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
|
@ -19,7 +19,7 @@ namespace Kernel {
|
|||
|
||||
// RTL8618 / RTL8111 Driver based on https://people.freebsd.org/~wpaul/RealTek/RTL8111B_8168B_Registers_DataSheet_1.0.pdf
|
||||
class RTL8168NetworkAdapter final : public NetworkAdapter
|
||||
, public PCI::DeviceController
|
||||
, public PCI::Device
|
||||
, public IRQHandler {
|
||||
public:
|
||||
static RefPtr<RTL8168NetworkAdapter> try_to_initialize(PCI::Address);
|
||||
|
|
|
@ -80,7 +80,7 @@ volatile AHCI::HBA& AHCIController::hba() const
|
|||
|
||||
AHCIController::AHCIController(PCI::Address address)
|
||||
: StorageController()
|
||||
, PCI::DeviceController(address)
|
||||
, PCI::Device(address)
|
||||
, m_hba_region(default_hba_region())
|
||||
, m_capabilities(capabilities())
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ class AsyncBlockDeviceRequest;
|
|||
class AHCIPortHandler;
|
||||
class AHCIPort;
|
||||
class AHCIController final : public StorageController
|
||||
, public PCI::DeviceController {
|
||||
, public PCI::Device {
|
||||
friend class AHCIPortHandler;
|
||||
friend class AHCIPort;
|
||||
AK_MAKE_ETERNAL
|
||||
|
|
|
@ -52,7 +52,7 @@ void IDEController::complete_current_request(AsyncDeviceRequest::RequestResult)
|
|||
|
||||
UNMAP_AFTER_INIT IDEController::IDEController(PCI::Address address, bool force_pio)
|
||||
: StorageController()
|
||||
, PCI::DeviceController(address)
|
||||
, PCI::Device(address)
|
||||
{
|
||||
PCI::enable_io_space(address);
|
||||
PCI::enable_memory_space(address);
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Kernel {
|
|||
class AsyncBlockDeviceRequest;
|
||||
|
||||
class IDEController final : public StorageController
|
||||
, public PCI::DeviceController {
|
||||
, public PCI::Device {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
static NonnullRefPtr<IDEController> initialize(PCI::Address address, bool force_pio);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/DeviceController.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Devices/Device.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue