mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:38:13 +00:00
Kernel: Change get_pci_address() to pci_address() in PCI::Device class
The Serenity Coding Style tends to not accept the word "get" in methods' names if possible.
This commit is contained in:
parent
d51c81f475
commit
a7d7c0e60c
4 changed files with 18 additions and 18 deletions
|
@ -157,9 +157,9 @@ void PATAChannel::initialize(bool force_pio)
|
|||
}
|
||||
|
||||
// Let's try to set up DMA transfers.
|
||||
PCI::enable_bus_mastering(get_pci_address());
|
||||
PCI::enable_bus_mastering(pci_address());
|
||||
prdt().end_of_table = 0x8000;
|
||||
m_bus_master_base = PCI::get_BAR4(get_pci_address()) & 0xfffc;
|
||||
m_bus_master_base = PCI::get_BAR4(pci_address()) & 0xfffc;
|
||||
m_dma_buffer_page = MM.allocate_supervisor_physical_page();
|
||||
kprintf("PATAChannel: Bus master IDE: I/O @ %x\n", m_bus_master_base);
|
||||
}
|
||||
|
|
|
@ -133,23 +133,23 @@ void E1000NetworkAdapter::detect(const PCI::Address& address)
|
|||
(void)adopt(*new E1000NetworkAdapter(address, irq)).leak_ref();
|
||||
}
|
||||
|
||||
E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address pci_address, u8 irq)
|
||||
: PCI::Device(pci_address, irq)
|
||||
E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq)
|
||||
: PCI::Device(address, irq)
|
||||
{
|
||||
set_interface_name("e1k");
|
||||
|
||||
kprintf("E1000: Found at PCI address @ %w:%b:%b.%b\n", get_pci_address().seg(), get_pci_address().bus(), get_pci_address().slot(), get_pci_address().function());
|
||||
kprintf("E1000: Found at PCI address @ %w:%b:%b.%b\n", pci_address().seg(), pci_address().bus(), pci_address().slot(), pci_address().function());
|
||||
|
||||
enable_bus_mastering(get_pci_address());
|
||||
enable_bus_mastering(pci_address());
|
||||
|
||||
size_t mmio_base_size = PCI::get_BAR_Space_Size(pci_address, 0);
|
||||
m_mmio_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR0(get_pci_address()))), PAGE_ROUND_UP(mmio_base_size), "E1000 MMIO", Region::Access::Read | Region::Access::Write, false, false);
|
||||
size_t mmio_base_size = PCI::get_BAR_Space_Size(pci_address(), 0);
|
||||
m_mmio_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR0(pci_address()))), PAGE_ROUND_UP(mmio_base_size), "E1000 MMIO", Region::Access::Read | Region::Access::Write, false, false);
|
||||
m_mmio_base = m_mmio_region->vaddr();
|
||||
m_use_mmio = true;
|
||||
m_io_base = PCI::get_BAR1(get_pci_address()) & ~1;
|
||||
m_interrupt_line = PCI::get_interrupt_line(get_pci_address());
|
||||
m_io_base = PCI::get_BAR1(pci_address()) & ~1;
|
||||
m_interrupt_line = PCI::get_interrupt_line(pci_address());
|
||||
kprintf("E1000: IO port base: %w\n", m_io_base);
|
||||
kprintf("E1000: MMIO base: P%x\n", PCI::get_BAR0(pci_address) & 0xfffffffc);
|
||||
kprintf("E1000: MMIO base: P%x\n", PCI::get_BAR0(pci_address()) & 0xfffffffc);
|
||||
kprintf("E1000: MMIO base size: %u bytes\n", mmio_base_size);
|
||||
kprintf("E1000: Interrupt line: %u\n", m_interrupt_line);
|
||||
detect_eeprom();
|
||||
|
|
|
@ -137,17 +137,17 @@ void RTL8139NetworkAdapter::detect(const PCI::Address& address)
|
|||
(void)adopt(*new RTL8139NetworkAdapter(address, irq)).leak_ref();
|
||||
}
|
||||
|
||||
RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address pci_address, u8 irq)
|
||||
: PCI::Device(pci_address, irq)
|
||||
RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address address, u8 irq)
|
||||
: PCI::Device(address, irq)
|
||||
{
|
||||
set_interface_name("rtl8139");
|
||||
|
||||
kprintf("RTL8139: Found at PCI address %b:%b:%b\n", get_pci_address().bus(), get_pci_address().slot(), get_pci_address().function());
|
||||
kprintf("RTL8139: Found at PCI address %b:%b:%b\n", pci_address().bus(), pci_address().slot(), pci_address().function());
|
||||
|
||||
enable_bus_mastering(get_pci_address());
|
||||
enable_bus_mastering(pci_address());
|
||||
|
||||
m_io_base = PCI::get_BAR0(get_pci_address()) & ~1;
|
||||
m_interrupt_line = PCI::get_interrupt_line(get_pci_address());
|
||||
m_io_base = PCI::get_BAR0(pci_address()) & ~1;
|
||||
m_interrupt_line = PCI::get_interrupt_line(pci_address());
|
||||
kprintf("RTL8139: IO port base: %w\n", m_io_base);
|
||||
kprintf("RTL8139: Interrupt line: %u\n", m_interrupt_line);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
namespace Kernel {
|
||||
class PCI::Device : public IRQHandler {
|
||||
public:
|
||||
Address get_pci_address() const { return m_pci_address; };
|
||||
Address pci_address() const { return m_pci_address; };
|
||||
|
||||
protected:
|
||||
Device(Address pci_address);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue