1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-04 10:11:51 +00:00

Don't allocate all vm state in a continuous block

This commit is contained in:
momo5502
2022-04-02 20:22:20 +02:00
parent 4253953003
commit 4bb5dca1ea
4 changed files with 115 additions and 87 deletions

View File

@ -9,6 +9,15 @@ namespace memory
_IRQL_requires_max_(DISPATCH_LEVEL)
void* allocate_aligned_memory(size_t size);
_Must_inspect_result_
_IRQL_requires_max_(DISPATCH_LEVEL)
template <typename T>
T* allocate_aligned_object()
{
return static_cast<T*>(allocate_aligned_memory(sizeof(T)));
}
uint64_t get_physical_address(void* address);
void* get_virtual_address(uint64_t address);