Skip to content

Commit

Permalink
Kernel: Slap a handful more things with UNMAP_AFTER_INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Feb 19, 2021
1 parent 4f0be55 commit cc0f591
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Kernel/Arch/i386/CPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ void Processor::Processor::halt()
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]);
for (size_t i = 0; i < pool_count; i++) {
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Devices/NullDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Kernel {

static AK::Singleton<NullDevice> s_the;

void NullDevice::initialize()
UNMAP_AFTER_INIT void NullDevice::initialize()
{
s_the.ensure_instance();
}
Expand Down
10 changes: 5 additions & 5 deletions Kernel/Net/E1000NetworkAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void E1000NetworkAdapter::handle_irq(const RegisterState&)
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);
for (int i = 0; i < 999; ++i) {
Expand All @@ -276,7 +276,7 @@ void E1000NetworkAdapter::detect_eeprom()
m_has_eeprom = false;
}

u32 E1000NetworkAdapter::read_eeprom(u8 address)
UNMAP_AFTER_INIT u32 E1000NetworkAdapter::read_eeprom(u8 address)
{
u16 data = 0;
u32 tmp = 0;
Expand All @@ -293,7 +293,7 @@ u32 E1000NetworkAdapter::read_eeprom(u8 address)
return data;
}

void E1000NetworkAdapter::read_mac_address()
UNMAP_AFTER_INIT void E1000NetworkAdapter::read_mac_address()
{
if (m_has_eeprom) {
MACAddress mac {};
Expand All @@ -317,7 +317,7 @@ bool E1000NetworkAdapter::link_up()
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();
for (size_t i = 0; i < number_of_rx_descriptors; ++i) {
Expand All @@ -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);
}

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();
for (size_t i = 0; i < number_of_tx_descriptors; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Net/RTL8139NetworkAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void RTL8139NetworkAdapter::reset()
out16(REG_ISR, 0xffff);
}

void RTL8139NetworkAdapter::read_mac_address()
UNMAP_AFTER_INIT void RTL8139NetworkAdapter::read_mac_address()
{
MACAddress mac {};
for (int i = 0; i < 6; i++)
Expand Down
10 changes: 5 additions & 5 deletions Kernel/Storage/IDEChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace Kernel {
#define PCI_Mass_Storage_Class 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);
}
Expand All @@ -128,7 +128,7 @@ RefPtr<StorageDevice> IDEChannel::slave_device() const
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)
, m_channel_type(type)
, m_io_group(io_group)
Expand All @@ -153,7 +153,7 @@ void IDEChannel::clear_pending_interrupts() const
m_io_group.io_base().offset(ATA_REG_STATUS).in<u8>();
}

IDEChannel::~IDEChannel()
UNMAP_AFTER_INIT IDEChannel::~IDEChannel()
{
}

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -368,7 +368,7 @@ String IDEChannel::channel_type_string() const
return "Secondary";
}

void IDEChannel::detect_disks()
UNMAP_AFTER_INIT void IDEChannel::detect_disks()
{
auto channel_string = [](u8 i) -> const char* {
if (i == 0)
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Syscall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace Syscall {

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);
klog() << "Syscall: int 0x82 handler installed";
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Time/PIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define IRQ_TIMER 0
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)));
}
Expand Down

0 comments on commit cc0f591

Please sign in to comment.