diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-06 01:36:14 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 01:55:27 +0200 |
commit | 75564b4a5f2b5452163571116ee9efaf5c3c65af (patch) | |
tree | ec672e92fcf3e7dca6ed51bce1c287319a9fc77d /Kernel/Net/RTL8139NetworkAdapter.cpp | |
parent | cb71a7370836c3b70038e2f718ee87f6fc286229 (diff) | |
download | serenity-75564b4a5f2b5452163571116ee9efaf5c3c65af.zip |
Kernel: Make kernel region allocators return KResultOr<NOP<Region>>
This expands the reach of error propagation greatly throughout the
kernel. Sadly, it also exposes the fact that we're allocating (and
doing other fallible things) in constructors all over the place.
This patch doesn't attempt to address that of course. That's work for
our future selves.
Diffstat (limited to 'Kernel/Net/RTL8139NetworkAdapter.cpp')
-rw-r--r-- | Kernel/Net/RTL8139NetworkAdapter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/RTL8139NetworkAdapter.cpp b/Kernel/Net/RTL8139NetworkAdapter.cpp index bf08708ee2..be2ab32e26 100644 --- a/Kernel/Net/RTL8139NetworkAdapter.cpp +++ b/Kernel/Net/RTL8139NetworkAdapter.cpp @@ -125,8 +125,8 @@ UNMAP_AFTER_INIT RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address addre : 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)) - , m_packet_buffer(MM.allocate_contiguous_kernel_region(Memory::page_round_up(PACKET_SIZE_MAX), "RTL8139 Packet buffer", Memory::Region::Access::ReadWrite)) + , m_rx_buffer(MM.allocate_contiguous_kernel_region(Memory::page_round_up(RX_BUFFER_SIZE + PACKET_SIZE_MAX), "RTL8139 RX", Memory::Region::Access::ReadWrite).release_value()) + , m_packet_buffer(MM.allocate_contiguous_kernel_region(Memory::page_round_up(PACKET_SIZE_MAX), "RTL8139 Packet buffer", Memory::Region::Access::ReadWrite).release_value()) { m_tx_buffers.ensure_capacity(RTL8139_TX_BUFFER_COUNT); set_interface_name(address); @@ -145,7 +145,7 @@ UNMAP_AFTER_INIT RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address addre dbgln("RTL8139: RX buffer: {}", m_rx_buffer->physical_page(0)->paddr()); for (int i = 0; i < RTL8139_TX_BUFFER_COUNT; i++) { - m_tx_buffers.append(MM.allocate_contiguous_kernel_region(Memory::page_round_up(TX_BUFFER_SIZE), "RTL8139 TX", Memory::Region::Access::Write | Memory::Region::Access::Read)); + m_tx_buffers.append(MM.allocate_contiguous_kernel_region(Memory::page_round_up(TX_BUFFER_SIZE), "RTL8139 TX", Memory::Region::Access::Write | Memory::Region::Access::Read).release_value()); dbgln("RTL8139: TX buffer {}: {}", i, m_tx_buffers[i]->physical_page(0)->paddr()); } |