1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 01:27:44 +00:00

Kernel: Remove problematic memory mapping methods

mmap() & mmap_region() methods are removed from ACPI & DMI components,
and we replace them with the new MM.allocate_kernel_region() helper.

Instead of doing a raw calculation for each VM address, from now on we
can use helper functions to do perform those calculations in a neat,
reusable and readable way.
This commit is contained in:
Liav A 2020-01-09 23:33:36 +02:00 committed by Andreas Kling
parent d2b41010c5
commit a9884fbbe5
10 changed files with 117 additions and 160 deletions

View file

@ -135,7 +135,7 @@ void disable_bus_mastering(Address address)
{
PCI::Access::the().disable_bus_mastering(address);
}
u32 get_BAR_Space_Size(Address address, u8 bar_number)
size_t get_BAR_Space_Size(Address address, u8 bar_number)
{
return PCI::Access::the().get_BAR_Space_Size(address, bar_number);
}

View file

@ -14,7 +14,7 @@ public:
virtual u32 get_BAR4(Address address) { return read32_field(address, PCI_BAR4); }
virtual u32 get_BAR5(Address address) { return read32_field(address, PCI_BAR5); }
virtual u32 get_BAR_Space_Size(Address address, u8 bar_number)
virtual size_t get_BAR_Space_Size(Address address, u8 bar_number)
{
// See PCI Spec 2.3, Page 222
ASSERT(bar_number < 6);

View file

@ -135,7 +135,7 @@ u8 get_subclass(Address);
u8 get_class(Address);
u16 get_subsystem_id(Address);
u16 get_subsystem_vendor_id(Address);
u32 get_BAR_Space_Size(Address, u8);
size_t get_BAR_Space_Size(Address, u8);
void enable_bus_mastering(Address);
void disable_bus_mastering(Address);