mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:17:44 +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:
parent
e920c74cae
commit
2b2828ae52
36 changed files with 105 additions and 105 deletions
|
@ -54,7 +54,7 @@ bool Access::is_initialized()
|
|||
return (s_access != nullptr);
|
||||
}
|
||||
|
||||
Access::Access()
|
||||
UNMAP_AFTER_INIT Access::Access()
|
||||
{
|
||||
s_access = this;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
namespace Kernel {
|
||||
namespace PCI {
|
||||
|
||||
void IOAccess::initialize()
|
||||
UNMAP_AFTER_INIT void IOAccess::initialize()
|
||||
{
|
||||
if (!Access::is_initialized()) {
|
||||
new IOAccess();
|
||||
|
@ -39,7 +39,7 @@ void IOAccess::initialize()
|
|||
}
|
||||
}
|
||||
|
||||
IOAccess::IOAccess()
|
||||
UNMAP_AFTER_INIT IOAccess::IOAccess()
|
||||
{
|
||||
klog() << "PCI: Using I/O instructions for PCI configuration space access";
|
||||
enumerate_hardware([&](const Address& address, ID id) {
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace PCI {
|
|||
|
||||
static bool test_pci_io();
|
||||
|
||||
static Access::Type detect_optimal_access_type(bool mmio_allowed)
|
||||
UNMAP_AFTER_INIT static Access::Type detect_optimal_access_type(bool mmio_allowed)
|
||||
{
|
||||
if (mmio_allowed && ACPI::is_enabled() && !ACPI::Parser::the()->find_table("MCFG").is_null())
|
||||
return Access::Type::MMIO;
|
||||
|
@ -48,7 +48,7 @@ static Access::Type detect_optimal_access_type(bool mmio_allowed)
|
|||
PANIC("No PCI bus access method detected!");
|
||||
}
|
||||
|
||||
void initialize()
|
||||
UNMAP_AFTER_INIT void initialize()
|
||||
{
|
||||
bool mmio_allowed = kernel_command_line().lookup("pci_mmio").value_or("off") == "on";
|
||||
|
||||
|
@ -61,7 +61,7 @@ void initialize()
|
|||
});
|
||||
}
|
||||
|
||||
bool test_pci_io()
|
||||
UNMAP_AFTER_INIT bool test_pci_io()
|
||||
{
|
||||
klog() << "Testing PCI via manual probing... ";
|
||||
u32 tmp = 0x80000000;
|
||||
|
|
|
@ -49,7 +49,7 @@ private:
|
|||
|
||||
#define PCI_MMIO_CONFIG_SPACE_SIZE 4096
|
||||
|
||||
DeviceConfigurationSpaceMapping::DeviceConfigurationSpaceMapping(Address device_address, const MMIOSegment& mmio_segment)
|
||||
UNMAP_AFTER_INIT DeviceConfigurationSpaceMapping::DeviceConfigurationSpaceMapping(Address device_address, const MMIOSegment& mmio_segment)
|
||||
: m_device_address(device_address)
|
||||
, m_mapped_region(MM.allocate_kernel_region(page_round_up(PCI_MMIO_CONFIG_SPACE_SIZE), "PCI MMIO Device Access", Region::Access::Read | Region::Access::Write).release_nonnull())
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ uint8_t MMIOAccess::segment_end_bus(u32 seg) const
|
|||
return segment.value().get_end_bus();
|
||||
}
|
||||
|
||||
void MMIOAccess::initialize(PhysicalAddress mcfg)
|
||||
UNMAP_AFTER_INIT void MMIOAccess::initialize(PhysicalAddress mcfg)
|
||||
{
|
||||
if (!Access::is_initialized()) {
|
||||
new MMIOAccess(mcfg);
|
||||
|
@ -89,7 +89,7 @@ void MMIOAccess::initialize(PhysicalAddress mcfg)
|
|||
}
|
||||
}
|
||||
|
||||
MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)
|
||||
UNMAP_AFTER_INIT MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)
|
||||
: m_mcfg(p_mcfg)
|
||||
{
|
||||
klog() << "PCI: Using MMIO for PCI configuration space access";
|
||||
|
@ -131,7 +131,7 @@ MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)
|
|||
});
|
||||
}
|
||||
|
||||
Optional<VirtualAddress> MMIOAccess::get_device_configuration_space(Address address)
|
||||
UNMAP_AFTER_INIT Optional<VirtualAddress> MMIOAccess::get_device_configuration_space(Address address)
|
||||
{
|
||||
dbgln_if(PCI_DEBUG, "PCI: Getting device configuration space for {}", address);
|
||||
for (auto& mapping : m_mapped_device_regions) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue