lindows/lcrash/mm/phys.h

38 lines
577 B
C

#pragma once
#include <lcrash/types.h>
struct PmemAllocation {
/// Allocated address
void* Address;
/// \internal
u32 AllocationOrder;
/// \internal
u32 AllocationBlock;
};
/**
* Initialize the physical memory manager
*
* \return 0 on OK
*/
int PmemInitialize();
/**
* Allocate a block of physical pages
*
* \return 0 on OK
*/
[[gnu::nonnull(2)]]
int PmemAllocateBlock(uptr RequiredSize, struct PmemAllocation* Allocated);
/**
* Free a block of physical pages
*
* \return 0 on OK
*/
[[gnu::nonnull(1)]]
int PmemFreeBlock(struct PmemAllocation* Block);