(kind of) finished the paging setup. We'll see...
This commit is contained in:
@@ -51,7 +51,7 @@ struct MemoryRange
|
||||
}
|
||||
};
|
||||
|
||||
void setupPaging(std::span<const MemoryRange> memoryRanges) noexcept;
|
||||
[[nodiscard]] bool setupPaging(std::span<const MemoryRange> memoryRanges) noexcept;
|
||||
[[nodiscard]] const char* memoryTypeName(MemoryType type) noexcept;
|
||||
|
||||
[[nodiscard]] void* allocatePages(unsigned numConsecutive) noexcept;
|
||||
@@ -67,6 +67,14 @@ inline void identityMapRegion(void* start, std::size_t bytes) noexcept
|
||||
std::uint64_t lastPage = std::bit_cast<std::uint64_t>(static_cast<std::uint8_t*>(start) + bytes) / 4096 + 1;
|
||||
setupIdentityPaging(firstPage, lastPage);
|
||||
}
|
||||
|
||||
template<typename T = void>
|
||||
inline T* pageToPointer(std::uint64_t page) noexcept
|
||||
{
|
||||
return std::bit_cast<T*>(page << 12);
|
||||
}
|
||||
}
|
||||
|
||||
void __ba_initInitialHeap() noexcept;
|
||||
|
||||
#endif // !defined(BAD_APPLE_OS_OS_MEMORY_HPP_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user