70de440326
Signed-off-by: Chloe M. <chloe@mensia.org>
41 lines
866 B
C
41 lines
866 B
C
/*
|
|
* Copyright (c) 2026, Chloe M.
|
|
* Provided under the BSD-3 clause.
|
|
*
|
|
* Description: Virtual address descriptor management
|
|
* Author: Chloe M.
|
|
*/
|
|
|
|
#ifndef _MM_VAD_H_
|
|
#define _MM_VAD_H_ 1
|
|
|
|
#include <ptdef.h>
|
|
#include <mm/vmm.h>
|
|
#include <tree.h>
|
|
|
|
/*
|
|
* A virtual address descriptor represents a single page
|
|
* of memory that can be allocated.
|
|
*
|
|
* @Range: Virtual memory range this covers
|
|
* @TreeLink: Red-black tree link
|
|
*/
|
|
typedef struct _MM_VAD {
|
|
MM_RANGE Range;
|
|
RB_ENTRY(_MM_VAD) TreeLink;
|
|
} MM_VAD;
|
|
|
|
/*
|
|
* A virtual address descriptor tree lists a collection
|
|
* of virtual address descriptors in an ordered manner.
|
|
*
|
|
* @Head: Head of the red-black tree
|
|
* @Elements Number of elements in red-black tree
|
|
*/
|
|
typedef struct {
|
|
RB_HEAD(VadTree, _MM_VAD) Head;
|
|
USIZE Elements;
|
|
} MM_VAD_TREE;
|
|
|
|
#endif /* !_MM_VAD_H_ */
|