public static unsafe void Map(this IPageTable table, Addr virtAddr, Addr physAddr, IPageFrameAllocator physAllocator, bool present = true, bool flush = false) { var page = physAllocator.GetPageByAddress(physAddr); var pAddr = physAllocator.GetAddress(page); while (true) { table.Map(virtAddr, pAddr, present, flush); page = physAllocator.NextCompoundPage(page); pAddr = physAllocator.GetAddress(page); if (page == null || pAddr == physAddr) { break; } virtAddr += 4096; } }
public static Page *GetPhysPage(Addr physAddr) { return(Default.GetPageByAddress(physAddr)); }
public static void FreeAddr(this IPageFrameAllocator allocator, Addr addr) { allocator.Free(allocator.GetPageByAddress(addr)); }