diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-19 21:29:46 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-19 21:42:18 +0100 |
commit | 2b2828ae525d22858f303f288df69e8235d3486f (patch) | |
tree | ed2b50b39f080df29c07a54f06a356b1be345635 /Kernel/Net | |
parent | e920c74cae13faac1ce2db6d921a5bbbcab39335 (diff) | |
download | serenity-2b2828ae525d22858f303f288df69e8235d3486f.zip |
Kernel: Slap UNMAP_AFTER_INIT on a bunch more functions
We're now able to unmap 100 KiB of kernel text after init. :^)
Diffstat (limited to 'Kernel/Net')
-rw-r--r-- | Kernel/Net/E1000NetworkAdapter.cpp | 6 | ||||
-rw-r--r-- | Kernel/Net/NE2000NetworkAdapter.cpp | 6 | ||||
-rw-r--r-- | Kernel/Net/RTL8139NetworkAdapter.cpp | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp index 47844809eb..8e509132f8 100644 --- a/Kernel/Net/E1000NetworkAdapter.cpp +++ b/Kernel/Net/E1000NetworkAdapter.cpp @@ -179,7 +179,7 @@ static bool is_valid_device_id(u16 device_id) } } -void E1000NetworkAdapter::detect() +UNMAP_AFTER_INIT void E1000NetworkAdapter::detect() { PCI::enumerate([&](const PCI::Address& address, PCI::ID id) { if (address.is_null()) @@ -193,7 +193,7 @@ void E1000NetworkAdapter::detect() }); } -E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq) +UNMAP_AFTER_INIT E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq) : PCI::Device(address, irq) , m_io_base(PCI::get_BAR1(pci_address()) & ~1) , m_rx_descriptors_region(MM.allocate_contiguous_kernel_region(page_round_up(sizeof(e1000_rx_desc) * number_of_rx_descriptors + 16), "E1000 RX", Region::Access::Read | Region::Access::Write)) @@ -235,7 +235,7 @@ E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq) enable_irq(); } -E1000NetworkAdapter::~E1000NetworkAdapter() +UNMAP_AFTER_INIT E1000NetworkAdapter::~E1000NetworkAdapter() { } diff --git a/Kernel/Net/NE2000NetworkAdapter.cpp b/Kernel/Net/NE2000NetworkAdapter.cpp index 86b7222441..430775f61b 100644 --- a/Kernel/Net/NE2000NetworkAdapter.cpp +++ b/Kernel/Net/NE2000NetworkAdapter.cpp @@ -155,7 +155,7 @@ struct [[gnu::packed]] received_packet_header { u16 length; }; -void NE2000NetworkAdapter::detect() +UNMAP_AFTER_INIT void NE2000NetworkAdapter::detect() { static const auto ne2k_ids = Array<PCI::ID, 11> { PCI::ID { 0x10EC, 0x8029 }, // RealTek RTL-8029(AS) @@ -182,7 +182,7 @@ void NE2000NetworkAdapter::detect() }); } -NE2000NetworkAdapter::NE2000NetworkAdapter(PCI::Address address, u8 irq) +UNMAP_AFTER_INIT NE2000NetworkAdapter::NE2000NetworkAdapter(PCI::Address address, u8 irq) : PCI::Device(address, irq) , m_io_base(PCI::get_BAR0(pci_address()) & ~3) { @@ -203,7 +203,7 @@ NE2000NetworkAdapter::NE2000NetworkAdapter(PCI::Address address, u8 irq) enable_irq(); } -NE2000NetworkAdapter::~NE2000NetworkAdapter() +UNMAP_AFTER_INIT NE2000NetworkAdapter::~NE2000NetworkAdapter() { } diff --git a/Kernel/Net/RTL8139NetworkAdapter.cpp b/Kernel/Net/RTL8139NetworkAdapter.cpp index a3fb64e393..bc3e85243b 100644 --- a/Kernel/Net/RTL8139NetworkAdapter.cpp +++ b/Kernel/Net/RTL8139NetworkAdapter.cpp @@ -125,7 +125,7 @@ namespace Kernel { #define RX_BUFFER_SIZE 32768 #define TX_BUFFER_SIZE PACKET_SIZE_MAX -void RTL8139NetworkAdapter::detect() +UNMAP_AFTER_INIT void RTL8139NetworkAdapter::detect() { static const PCI::ID rtl8139_id = { 0x10EC, 0x8139 }; PCI::enumerate([&](const PCI::Address& address, PCI::ID id) { @@ -138,7 +138,7 @@ void RTL8139NetworkAdapter::detect() }); } -RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address address, u8 irq) +UNMAP_AFTER_INIT RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address address, u8 irq) : PCI::Device(address, irq) , m_io_base(PCI::get_BAR0(pci_address()) & ~1) , m_rx_buffer(MM.allocate_contiguous_kernel_region(page_round_up(RX_BUFFER_SIZE + PACKET_SIZE_MAX), "RTL8139 RX", Region::Access::Read | Region::Access::Write)) @@ -174,7 +174,7 @@ RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address address, u8 irq) enable_irq(); } -RTL8139NetworkAdapter::~RTL8139NetworkAdapter() +UNMAP_AFTER_INIT RTL8139NetworkAdapter::~RTL8139NetworkAdapter() { } |