ptos: mm: Add virtual address descriptor defs
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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_ */
|
||||
Reference in New Issue
Block a user