mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
Kernel: Make MemoryManager API type-safe for Region::Access enum
Increase type-safety moving the MemoryManager APIs which take a Region::Access to actually use that type instead of a `u8`. Eventually the actually m_access can be moved there as well, but I hit some weird bug where it wasn't using the correct operators in `set_access_bit(..)` even though it's declared (and tested). Something to fix-up later.
This commit is contained in:
parent
c825159f01
commit
eaef57443c
6 changed files with 39 additions and 35 deletions
|
@ -44,7 +44,7 @@ struct TypedMapping {
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
static TypedMapping<T> map_typed(PhysicalAddress paddr, size_t length, u8 access = Region::Access::Read)
|
||||
static TypedMapping<T> map_typed(PhysicalAddress paddr, size_t length, Region::Access access = Region::Access::Read)
|
||||
{
|
||||
TypedMapping<T> table;
|
||||
table.region = MM.allocate_kernel_region(paddr.page_base(), page_round_up(length), {}, access);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue