1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +00:00

Kernel: Slap UNMAP_AFTER_INIT on a bunch more functions

We're now able to unmap 100 KiB of kernel text after init. :^)
This commit is contained in:
Andreas Kling 2021-02-19 21:29:46 +01:00
parent e920c74cae
commit 2b2828ae52
36 changed files with 105 additions and 105 deletions

View file

@ -60,7 +60,7 @@ namespace Kernel {
static AK::Singleton<BXVGADevice> s_the;
void BXVGADevice::initialize()
UNMAP_AFTER_INIT void BXVGADevice::initialize()
{
s_the.ensure_instance();
}
@ -70,7 +70,7 @@ BXVGADevice& BXVGADevice::the()
return *s_the;
}
BXVGADevice::BXVGADevice()
UNMAP_AFTER_INIT BXVGADevice::BXVGADevice()
: BlockDevice(29, 0)
{
@ -157,7 +157,7 @@ void BXVGADevice::set_y_offset(size_t y_offset)
set_register(VBE_DISPI_INDEX_Y_OFFSET, (u16)y_offset);
}
u32 BXVGADevice::find_framebuffer_address()
UNMAP_AFTER_INIT u32 BXVGADevice::find_framebuffer_address()
{
// NOTE: The QEMU card has the same PCI ID as the Bochs one.
static const PCI::ID bochs_vga_id = { 0x1234, 0x1111 };

View file

@ -404,7 +404,7 @@ static const Keyboard::CharacterMapData DEFAULT_CHARACTER_MAP =
};
// clang-format on
KeyboardDevice::KeyboardDevice()
UNMAP_AFTER_INIT KeyboardDevice::KeyboardDevice()
: IRQHandler(IRQ_KEYBOARD)
, CharacterDevice(85, 1)
, m_controller(I8042Controller::the())
@ -412,11 +412,11 @@ KeyboardDevice::KeyboardDevice()
{
}
KeyboardDevice::~KeyboardDevice()
UNMAP_AFTER_INIT KeyboardDevice::~KeyboardDevice()
{
}
bool KeyboardDevice::initialize()
UNMAP_AFTER_INIT bool KeyboardDevice::initialize()
{
if (!m_controller.reset_device(I8042Controller::Device::Keyboard)) {
dbgln("KeyboardDevice: I8042 controller failed to reset device");

View file

@ -40,7 +40,7 @@ MBVGADevice& MBVGADevice::the()
return *s_the;
}
MBVGADevice::MBVGADevice(PhysicalAddress addr, size_t pitch, size_t width, size_t height)
UNMAP_AFTER_INIT MBVGADevice::MBVGADevice(PhysicalAddress addr, size_t pitch, size_t width, size_t height)
: BlockDevice(29, 0)
, m_framebuffer_address(addr)
, m_framebuffer_pitch(pitch)

View file

@ -33,12 +33,12 @@
namespace Kernel {
MemoryDevice::MemoryDevice()
UNMAP_AFTER_INIT MemoryDevice::MemoryDevice()
: CharacterDevice(1, 1)
{
}
MemoryDevice::~MemoryDevice()
UNMAP_AFTER_INIT MemoryDevice::~MemoryDevice()
{
}

View file

@ -51,14 +51,14 @@ namespace Kernel {
static AK::Singleton<PS2MouseDevice> s_the;
PS2MouseDevice::PS2MouseDevice()
UNMAP_AFTER_INIT PS2MouseDevice::PS2MouseDevice()
: IRQHandler(IRQ_MOUSE)
, CharacterDevice(10, 1)
, m_controller(I8042Controller::the())
{
}
PS2MouseDevice::~PS2MouseDevice()
UNMAP_AFTER_INIT PS2MouseDevice::~PS2MouseDevice()
{
}
@ -222,7 +222,7 @@ void PS2MouseDevice::set_sample_rate(u8 rate)
send_command(PS2MOUSE_SET_SAMPLE_RATE, rate);
}
bool PS2MouseDevice::initialize()
UNMAP_AFTER_INIT bool PS2MouseDevice::initialize()
{
if (!m_controller.reset_device(I8042Controller::Device::Mouse)) {
dbgln("PS2MouseDevice: I8042 controller failed to reset device");

View file

@ -78,18 +78,18 @@ void SB16::set_sample_rate(uint16_t hz)
static AK::Singleton<SB16> s_the;
SB16::SB16()
UNMAP_AFTER_INIT SB16::SB16()
: IRQHandler(SB16_DEFAULT_IRQ)
, CharacterDevice(42, 42) // ### ?
{
initialize();
}
SB16::~SB16()
UNMAP_AFTER_INIT SB16::~SB16()
{
}
void SB16::detect()
UNMAP_AFTER_INIT void SB16::detect()
{
IO::out8(0x226, 1);
IO::delay(32);
@ -102,7 +102,7 @@ void SB16::detect()
SB16::create();
}
void SB16::create()
UNMAP_AFTER_INIT void SB16::create()
{
s_the.ensure_instance();
}
@ -112,7 +112,7 @@ SB16& SB16::the()
return *s_the;
}
void SB16::initialize()
UNMAP_AFTER_INIT void SB16::initialize()
{
disable_irq();

View file

@ -29,14 +29,14 @@
namespace Kernel {
SerialDevice::SerialDevice(int base_addr, unsigned minor)
UNMAP_AFTER_INIT SerialDevice::SerialDevice(int base_addr, unsigned minor)
: CharacterDevice(4, minor)
, m_base_addr(base_addr)
{
initialize();
}
SerialDevice::~SerialDevice()
UNMAP_AFTER_INIT SerialDevice::~SerialDevice()
{
}
@ -92,7 +92,7 @@ String SerialDevice::device_name() const
return String::formatted("ttyS{}", minor() - 64);
}
void SerialDevice::initialize()
UNMAP_AFTER_INIT void SerialDevice::initialize()
{
set_interrupts(0);
set_baud(Baud38400);
@ -101,7 +101,7 @@ void SerialDevice::initialize()
set_modem_control(RequestToSend | DataTerminalReady);
}
void SerialDevice::set_interrupts(char interrupt_enable)
UNMAP_AFTER_INIT void SerialDevice::set_interrupts(char interrupt_enable)
{
m_interrupt_enable = interrupt_enable;

View file

@ -86,7 +86,7 @@ UHCIController& UHCIController::the()
return *s_the;
}
void UHCIController::detect()
UNMAP_AFTER_INIT void UHCIController::detect()
{
#if !UHCI_ENABLED
return;
@ -102,7 +102,7 @@ void UHCIController::detect()
});
}
UHCIController::UHCIController(PCI::Address address, PCI::ID id)
UNMAP_AFTER_INIT UHCIController::UHCIController(PCI::Address address, PCI::ID id)
: PCI::Device(address)
, m_io_base(PCI::get_BAR4(pci_address()) & ~1)
{
@ -116,7 +116,7 @@ UHCIController::UHCIController(PCI::Address address, PCI::ID id)
spawn_port_proc();
}
UHCIController::~UHCIController()
UNMAP_AFTER_INIT UHCIController::~UHCIController()
{
}
@ -151,7 +151,7 @@ void UHCIController::reset()
klog() << "UHCI: Reset completed!";
}
void UHCIController::create_structures()
UNMAP_AFTER_INIT void UHCIController::create_structures()
{
// Let's allocate memory for botht the QH and TD pools
// First the QH pool and all of the Interrupt QH's
@ -224,7 +224,7 @@ void UHCIController::create_structures()
#endif
}
void UHCIController::setup_schedule()
UNMAP_AFTER_INIT void UHCIController::setup_schedule()
{
//
// https://github.com/alkber/minix3-usbsubsystem/blob/master/usb/uhci-hcd.c

View file

@ -116,7 +116,7 @@ VMWareBackdoor* VMWareBackdoor::the()
return s_vmware_backdoor->get_instance();
}
VMWareBackdoor::VMWareBackdoor()
UNMAP_AFTER_INIT VMWareBackdoor::VMWareBackdoor()
{
if (kernel_command_line().lookup("vmmouse").value_or("on") == "on")
enable_absolute_vmmouse();