summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-02-22 23:56:00 +0200
committerAndreas Kling <kling@serenityos.org>2020-02-24 11:27:03 +0100
commita7d7c0e60c7cfebbcbd20edf8df3f6897e125bf7 (patch)
tree80ccfa861c38b5b6a19e7755b34a0e5b77e2294b
parentd51c81f47523aa5775cdb7371be36437b3eaa329 (diff)
downloadserenity-a7d7c0e60c7cfebbcbd20edf8df3f6897e125bf7.zip
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.
-rw-r--r--Kernel/Devices/PATAChannel.cpp4
-rw-r--r--Kernel/Net/E1000NetworkAdapter.cpp18
-rw-r--r--Kernel/Net/RTL8139NetworkAdapter.cpp12
-rw-r--r--Kernel/PCI/Device.h2
4 files changed, 18 insertions, 18 deletions
diff --git a/Kernel/Devices/PATAChannel.cpp b/Kernel/Devices/PATAChannel.cpp
index 0bc54596f3..0377ebcd08 100644
--- a/Kernel/Devices/PATAChannel.cpp
+++ b/Kernel/Devices/PATAChannel.cpp
@@ -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);
}
diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp
index 7acbabfce7..ec9e0bb4c4 100644
--- a/Kernel/Net/E1000NetworkAdapter.cpp
+++ b/Kernel/Net/E1000NetworkAdapter.cpp
@@ -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();
diff --git a/Kernel/Net/RTL8139NetworkAdapter.cpp b/Kernel/Net/RTL8139NetworkAdapter.cpp
index 14ac1e8efb..67f26e4945 100644
--- a/Kernel/Net/RTL8139NetworkAdapter.cpp
+++ b/Kernel/Net/RTL8139NetworkAdapter.cpp
@@ -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);
diff --git a/Kernel/PCI/Device.h b/Kernel/PCI/Device.h
index 22fce33e5d..429e7d5d9e 100644
--- a/Kernel/PCI/Device.h
+++ b/Kernel/PCI/Device.h
@@ -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);