Files
Chloe M. d337a3d55b stos: mm: Add virtual page allocation
Signed-off-by: Chloe M. <chloe@mensia.org>
2026-06-23 09:52:44 +00:00

37 lines
660 B
C

/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: Virtual memory manager
* Author: Chloe M.
*/
#ifndef _MM_VMM_H_
#define _MM_VMM_H_ 1
#include <stdef.h>
#include <ke/bpal.h>
#define VALLOC_BASE 0xFFFF804000000000
#define PMA_TO_VMA(PMA) \
PTR_OFFSET((VOID *)PMA, KeBpalLoadBase())
#define VMA_TO_PMA(VMA) \
(UPTR)PTR_NOFFSET(VMA, KeBpalLoadBase())
/*
* Initialize the virtual memory manager
*/
VOID MmInitVmm(VOID);
/*
* Allocate a number of contiguous pages
*
* @Count: Number of pages to allocate
*
* Returns NULL on failure
*/
VOID *MmAllocPages(USIZE Count);
#endif /* !_MM_VMM_H_ */