Browse Source

Kernel: Slap a handful more things with UNMAP_AFTER_INIT

Andreas Kling 4 years ago
parent
commit
cc0f5917d3

+ 1 - 1
Kernel/Arch/i386/CPU.cpp

@@ -2049,7 +2049,7 @@ void Processor::Processor::halt()
     halt_this();
     halt_this();
 }
 }
 
 
-void Processor::deferred_call_pool_init()
+UNMAP_AFTER_INIT void Processor::deferred_call_pool_init()
 {
 {
     size_t pool_count = sizeof(m_deferred_call_pool) / sizeof(m_deferred_call_pool[0]);
     size_t pool_count = sizeof(m_deferred_call_pool) / sizeof(m_deferred_call_pool[0]);
     for (size_t i = 0; i < pool_count; i++) {
     for (size_t i = 0; i < pool_count; i++) {

+ 1 - 1
Kernel/Devices/NullDevice.cpp

@@ -32,7 +32,7 @@ namespace Kernel {
 
 
 static AK::Singleton<NullDevice> s_the;
 static AK::Singleton<NullDevice> s_the;
 
 
-void NullDevice::initialize()
+UNMAP_AFTER_INIT void NullDevice::initialize()
 {
 {
     s_the.ensure_instance();
     s_the.ensure_instance();
 }
 }

+ 5 - 5
Kernel/Net/E1000NetworkAdapter.cpp

@@ -263,7 +263,7 @@ void E1000NetworkAdapter::handle_irq(const RegisterState&)
     out32(REG_INTERRUPT_MASK_SET, INTERRUPT_LSC | INTERRUPT_RXT0 | INTERRUPT_RXO);
     out32(REG_INTERRUPT_MASK_SET, INTERRUPT_LSC | INTERRUPT_RXT0 | INTERRUPT_RXO);
 }
 }
 
 
-void E1000NetworkAdapter::detect_eeprom()
+UNMAP_AFTER_INIT void E1000NetworkAdapter::detect_eeprom()
 {
 {
     out32(REG_EEPROM, 0x1);
     out32(REG_EEPROM, 0x1);
     for (int i = 0; i < 999; ++i) {
     for (int i = 0; i < 999; ++i) {
@@ -276,7 +276,7 @@ void E1000NetworkAdapter::detect_eeprom()
     m_has_eeprom = false;
     m_has_eeprom = false;
 }
 }
 
 
-u32 E1000NetworkAdapter::read_eeprom(u8 address)
+UNMAP_AFTER_INIT u32 E1000NetworkAdapter::read_eeprom(u8 address)
 {
 {
     u16 data = 0;
     u16 data = 0;
     u32 tmp = 0;
     u32 tmp = 0;
@@ -293,7 +293,7 @@ u32 E1000NetworkAdapter::read_eeprom(u8 address)
     return data;
     return data;
 }
 }
 
 
-void E1000NetworkAdapter::read_mac_address()
+UNMAP_AFTER_INIT void E1000NetworkAdapter::read_mac_address()
 {
 {
     if (m_has_eeprom) {
     if (m_has_eeprom) {
         MACAddress mac {};
         MACAddress mac {};
@@ -317,7 +317,7 @@ bool E1000NetworkAdapter::link_up()
     return (in32(REG_STATUS) & STATUS_LU);
     return (in32(REG_STATUS) & STATUS_LU);
 }
 }
 
 
-void E1000NetworkAdapter::initialize_rx_descriptors()
+UNMAP_AFTER_INIT void E1000NetworkAdapter::initialize_rx_descriptors()
 {
 {
     auto* rx_descriptors = (e1000_tx_desc*)m_rx_descriptors_region->vaddr().as_ptr();
     auto* rx_descriptors = (e1000_tx_desc*)m_rx_descriptors_region->vaddr().as_ptr();
     for (size_t i = 0; i < number_of_rx_descriptors; ++i) {
     for (size_t i = 0; i < number_of_rx_descriptors; ++i) {
@@ -338,7 +338,7 @@ void E1000NetworkAdapter::initialize_rx_descriptors()
     out32(REG_RCTRL, RCTL_EN | RCTL_SBP | RCTL_UPE | RCTL_MPE | RCTL_LBM_NONE | RTCL_RDMTS_HALF | RCTL_BAM | RCTL_SECRC | RCTL_BSIZE_8192);
     out32(REG_RCTRL, RCTL_EN | RCTL_SBP | RCTL_UPE | RCTL_MPE | RCTL_LBM_NONE | RTCL_RDMTS_HALF | RCTL_BAM | RCTL_SECRC | RCTL_BSIZE_8192);
 }
 }
 
 
-void E1000NetworkAdapter::initialize_tx_descriptors()
+UNMAP_AFTER_INIT void E1000NetworkAdapter::initialize_tx_descriptors()
 {
 {
     auto* tx_descriptors = (e1000_tx_desc*)m_tx_descriptors_region->vaddr().as_ptr();
     auto* tx_descriptors = (e1000_tx_desc*)m_tx_descriptors_region->vaddr().as_ptr();
     for (size_t i = 0; i < number_of_tx_descriptors; ++i) {
     for (size_t i = 0; i < number_of_tx_descriptors; ++i) {

+ 1 - 1
Kernel/Net/RTL8139NetworkAdapter.cpp

@@ -282,7 +282,7 @@ void RTL8139NetworkAdapter::reset()
     out16(REG_ISR, 0xffff);
     out16(REG_ISR, 0xffff);
 }
 }
 
 
-void RTL8139NetworkAdapter::read_mac_address()
+UNMAP_AFTER_INIT void RTL8139NetworkAdapter::read_mac_address()
 {
 {
     MACAddress mac {};
     MACAddress mac {};
     for (int i = 0; i < 6; i++)
     for (int i = 0; i < 6; i++)

+ 5 - 5
Kernel/Storage/IDEChannel.cpp

@@ -113,7 +113,7 @@ namespace Kernel {
 #define PCI_Mass_Storage_Class 0x1
 #define PCI_Mass_Storage_Class 0x1
 #define PCI_IDE_Controller_Subclass 0x1
 #define PCI_IDE_Controller_Subclass 0x1
 
 
-NonnullOwnPtr<IDEChannel> IDEChannel::create(const IDEController& controller, IOAddressGroup io_group, ChannelType type, bool force_pio)
+UNMAP_AFTER_INIT NonnullOwnPtr<IDEChannel> IDEChannel::create(const IDEController& controller, IOAddressGroup io_group, ChannelType type, bool force_pio)
 {
 {
     return make<IDEChannel>(controller, io_group, type, force_pio);
     return make<IDEChannel>(controller, io_group, type, force_pio);
 }
 }
@@ -128,7 +128,7 @@ RefPtr<StorageDevice> IDEChannel::slave_device() const
     return m_slave;
     return m_slave;
 }
 }
 
 
-IDEChannel::IDEChannel(const IDEController& controller, IOAddressGroup io_group, ChannelType type, bool force_pio)
+UNMAP_AFTER_INIT IDEChannel::IDEChannel(const IDEController& controller, IOAddressGroup io_group, ChannelType type, bool force_pio)
     : IRQHandler(type == ChannelType::Primary ? PATA_PRIMARY_IRQ : PATA_SECONDARY_IRQ)
     : IRQHandler(type == ChannelType::Primary ? PATA_PRIMARY_IRQ : PATA_SECONDARY_IRQ)
     , m_channel_type(type)
     , m_channel_type(type)
     , m_io_group(io_group)
     , m_io_group(io_group)
@@ -153,7 +153,7 @@ void IDEChannel::clear_pending_interrupts() const
     m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>();
     m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>();
 }
 }
 
 
-IDEChannel::~IDEChannel()
+UNMAP_AFTER_INIT IDEChannel::~IDEChannel()
 {
 {
 }
 }
 
 
@@ -215,7 +215,7 @@ void IDEChannel::complete_current_request(AsyncDeviceRequest::RequestResult resu
     });
     });
 }
 }
 
 
-void IDEChannel::initialize(bool force_pio)
+UNMAP_AFTER_INIT void IDEChannel::initialize(bool force_pio)
 {
 {
     m_parent_controller->enable_pin_based_interrupts();
     m_parent_controller->enable_pin_based_interrupts();
 
 
@@ -368,7 +368,7 @@ String IDEChannel::channel_type_string() const
     return "Secondary";
     return "Secondary";
 }
 }
 
 
-void IDEChannel::detect_disks()
+UNMAP_AFTER_INIT void IDEChannel::detect_disks()
 {
 {
     auto channel_string = [](u8 i) -> const char* {
     auto channel_string = [](u8 i) -> const char* {
         if (i == 0)
         if (i == 0)

+ 1 - 1
Kernel/Syscall.cpp

@@ -71,7 +71,7 @@ namespace Syscall {
 
 
 static int handle(RegisterState&, u32 function, u32 arg1, u32 arg2, u32 arg3);
 static int handle(RegisterState&, u32 function, u32 arg1, u32 arg2, u32 arg3);
 
 
-void initialize()
+UNMAP_AFTER_INIT void initialize()
 {
 {
     register_user_callable_interrupt_handler(syscall_vector, syscall_asm_entry);
     register_user_callable_interrupt_handler(syscall_vector, syscall_asm_entry);
     klog() << "Syscall: int 0x82 handler installed";
     klog() << "Syscall: int 0x82 handler installed";

+ 1 - 1
Kernel/Time/PIT.cpp

@@ -35,7 +35,7 @@
 #define IRQ_TIMER 0
 #define IRQ_TIMER 0
 namespace Kernel {
 namespace Kernel {
 
 
-NonnullRefPtr<PIT> PIT::initialize(Function<void(const RegisterState&)> callback)
+UNMAP_AFTER_INIT NonnullRefPtr<PIT> PIT::initialize(Function<void(const RegisterState&)> callback)
 {
 {
     return adopt(*new PIT(move(callback)));
     return adopt(*new PIT(move(callback)));
 }
 }