Files
SystemPaw3/paw/stos/head/mm/vad.h
T
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

58 lines
1001 B
C

/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: VAD management
* Author: Chloe M.
*/
#ifndef _MM_VAD_H_
#define _MM_VAD_H_ 1
#include <stdef.h>
#define VAD_FROM_VMA(VMA) \
((MM_VAD *)(VMA))
/*
* A virtual address descriptor represents a specific
* page of memory.
*
* @Next: Next free page
* @Prev: Previous free page
*/
typedef struct _MM_VAD {
struct _MM_VAD *Next;
struct _MM_VAD *Prev;
} MM_VAD;
/*
* Represents a virtual address descriptor list
*
* @First: First entry in VAD list
* @Last: Last entry in VAD list
*/
typedef struct {
MM_VAD *First;
MM_VAD *Last;
} MM_VAD_LIST;
/*
* Append a VAD to VAD list
*
* @List: VAD list to append to
* @Vad: VAD list to append
*/
VOID MmVadListAppend(MM_VAD_LIST *List, MM_VAD *Vad);
/*
* Pop a VAD from a VAD list
*
* @List: VAD list to pop from
*
* Returns NULL if no more entries
*/
MM_VAD *MmVadListPop(MM_VAD_LIST *List);
#endif /* !_MM_VAD_H_ */